Lei Li has uploaded a new change for review.
Change subject: [WIP] rest-api: Model Networks
......................................................................
[WIP] rest-api: Model Networks
API Implemented:
----------------
/api/networks
* list, create, confirm and edit configuration for network
Actions:
/api/networks/add
- Add a new network
/api/networks/confirm
- Mark the current network configurations as safe
/api/networks/<id>/delete
- DELETE a network
/api/networks/<id>/edit
- Add a new network and replace the old one
API as TODO:
---------------
/api/networks/<id...>/setup
- Add/Edit/Remove configuration for networks
Change-Id: Ic7eca74c16699a5cc35c4077192fb6ecfe706470
Signed-off-by: Lei Li <lilei(a)linux.vnet.ibm.com>
---
M vdsm/rest/Controller.py
M vdsm/rest/templates/Makefile.am
M vdsm/rest/templates/api.xsd
A vdsm/rest/templates/network.json.x
A vdsm/rest/templates/network.xml.x
A vdsm/rest/templates/networks.json.x
A vdsm/rest/templates/networks.xml.x
M vdsm/rest/templates/root.json.x
M vdsm/rest/templates/root.xml.x
M vdsm/rest/templates/rsdl.xml
10 files changed, 377 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/81/5881/1
--
To view, visit http://gerrit.ovirt.org/5881
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic7eca74c16699a5cc35c4077192fb6ecfe706470
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Lei Li <lilei(a)linux.vnet.ibm.com>
Fernando Granha Jeronimo has uploaded a new change for review.
Change subject: Include vds_name parameter for node registration
......................................................................
Include vds_name parameter for node registration
Motivation: in ovirt, the vds_name does not need to be resolvable.
In order to allow an arbitrary name, a new kernel parameter was created
(node_name). If this paramter is not passed, vdsm-reg will stick to
the hostname of the node (the previous behavior).
Change-Id: Ic1b0bcc473ef1a034736f80e1424e211ddf02946
Signed-off-by: Fernando Granha Jeronimo <fgranha(a)linux.vnet.ibm.com>
---
M vdsm_reg/config.py.in
M vdsm_reg/vdsm-config
M vdsm_reg/vdsm-reg-cmdline
M vdsm_reg/vdsm-reg-setup.in
M vdsm_reg/vdsm-reg.conf.in
5 files changed, 19 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/36/8036/1
diff --git a/vdsm_reg/config.py.in b/vdsm_reg/config.py.in
index 6519ec2..d00b427 100644
--- a/vdsm_reg/config.py.in
+++ b/vdsm_reg/config.py.in
@@ -35,5 +35,6 @@
config.set('vars', 'vdc_host_port', '80')
config.set('vars', 'vdc_reg_port', '54321')
config.set('vars', 'vdc_reg_uri', '/SolidICE/VdsAutoRegistration.aspx')
+config.set('vars', 'vds_name', 'None')
config.set('vars', 'vdsm_conf_file', '/etc/vdsm/vdsm.conf')
config.set('vars', 'vdsm_dir', '@VDSMDIR@')
diff --git a/vdsm_reg/vdsm-config b/vdsm_reg/vdsm-config
index 1cb4c2c..6e0f7f3 100755
--- a/vdsm_reg/vdsm-config
+++ b/vdsm_reg/vdsm-config
@@ -65,6 +65,9 @@
rhevm_admin_password=*)
rhevm_admin_password=${i#rhevm_admin_password=}
;;
+ node_name=*)
+ node_name=${i#node_name=}
+ ;;
*)
;;
esac
@@ -75,6 +78,7 @@
vdc_managment_server=${managment_server%:*}
vdc_managment_port=${managment_server#*:}
strRHEVMAddress=$vdc_managment_server
+ vds_name=${node_name}
tmp_vdsm_reg_conf=`mktemp`
cat /etc/vdsm-reg/vdsm-reg.conf > "$tmp_vdsm_reg_conf"
echo "checkpoint 3::management_server: $vdc_managment_server, management_port: $vdc_managment_port" >> $LOG 2>&1
@@ -108,6 +112,11 @@
echo "No management_server_fingerprint found." | tee -a $LOG
fi
+ if [ ! -z "$vds_name" ]; then
+ sed --copy -i "s/\(^vds_name=\)\(..*$\)/\1${vds_name}/" \
+ /etc/vdsm-reg/vdsm-reg.conf
+ fi
+
## Set new configuration
fWriteConfig=1
else
diff --git a/vdsm_reg/vdsm-reg-cmdline b/vdsm_reg/vdsm-reg-cmdline
index 92ed468..e7f0047 100644
--- a/vdsm_reg/vdsm-reg-cmdline
+++ b/vdsm_reg/vdsm-reg-cmdline
@@ -3,4 +3,5 @@
management_server
management_server_fingerprint
rhevm_admin_password
+node_name
ovirt_vdsm_disable
diff --git a/vdsm_reg/vdsm-reg-setup.in b/vdsm_reg/vdsm-reg-setup.in
index 492e38d..8652293 100644
--- a/vdsm_reg/vdsm-reg-setup.in
+++ b/vdsm_reg/vdsm-reg-setup.in
@@ -48,7 +48,12 @@
self.vdsmDir = config.get('vars', 'vdsm_dir')
if self.vdcURL != "None":
self.ovirtURL = deployUtil.getMGTIP(self.vdsmDir, self.vdcName)
- self.ovirtName = socket.gethostname()
+
+ # use the name from config file, otherwise get the fqdn
+ self.ovirtName = config.get('vars', 'vds_name')
+ if self.ovirtName is None or self.ovirtName == "None":
+ self.ovirtName = socket.gethostname()
+
self.ovirtUID = deployUtil.getHostID()
else:
self.ovirtURL = "None"
diff --git a/vdsm_reg/vdsm-reg.conf.in b/vdsm_reg/vdsm-reg.conf.in
index 2e9df0d..c38401c 100644
--- a/vdsm_reg/vdsm-reg.conf.in
+++ b/vdsm_reg/vdsm-reg.conf.in
@@ -13,6 +13,8 @@
vdc_host_port=443
#The registrtion uri
vdc_reg_uri=/OvirtEngineWeb/register
+# The name of this node (it does not need to be resolvable)
+vds_name=None
#Upgrade settings
upgrade_iso_file=@VDSMUPGRADEDIR@/ovirt-node-image.iso
upgrade_mount_point=/live
--
To view, visit http://gerrit.ovirt.org/8036
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic1b0bcc473ef1a034736f80e1424e211ddf02946
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Fernando Granha Jeronimo <fgranha(a)linux.vnet.ibm.com>
Antoni Segura Puimedon has uploaded a new change for review.
Change subject: Added utility to ensure that files written to the file system happen atomically.
......................................................................
Added utility to ensure that files written to the file system happen atomically.
The only way in python to make a file be written in an atomic way is to take
advantage of the fact that in POSIX filesystems the rename operation is atomic.
Thus, we write the context to a temporary file on the same filesystem, sync on
the file descriptor and finally do the atomic file rename to the original file
we wanted to write.
For more info:
http://stackoverflow.com/questions/2333872/atomic-writing-to-file-with-pyth…http://stackoverflow.com/questions/7433057/is-rename-without-fsync-safe
Change-Id: Ibecd61d6746231a5a8cb17bad9a3302b01454f27
Signed-off-by: Antoni S. Puimedon <asegurap(a)redhat.com>
---
M vdsm/configNetwork.py
M vdsm/utils.py
2 files changed, 17 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/56/7656/1
diff --git a/vdsm/configNetwork.py b/vdsm/configNetwork.py
index 58117f8..b943574 100755
--- a/vdsm/configNetwork.py
+++ b/vdsm/configNetwork.py
@@ -369,7 +369,8 @@
'''Backs up the previous contents of the file referenced by fileName
writes the new configuration and sets the specified access mode.'''
self._backup(fileName)
- open(fileName, 'w').write(configuration)
+ with utils.atomicWrite(fileName) as f:
+ f.write(configuration)
os.chmod(fileName, 0664)
try:
selinux.restorecon(fileName)
diff --git a/vdsm/utils.py b/vdsm/utils.py
index 5e2d4e5..bb8a842 100644
--- a/vdsm/utils.py
+++ b/vdsm/utils.py
@@ -36,6 +36,7 @@
import fcntl
import functools
import stat
+from contextlib import contextmanager
import ethtool
@@ -829,3 +830,17 @@
def __unicode__(self):
return unicode(self.cmd)
+
+@contextmanager
+def atomicWrite(file):
+ '''Context manager that makes the write happen to a temporary file and if
+ and only it is successful, overwrites the original file. It creates the
+ temporary file in the same directory of the destination file, as rename is
+ only atomic within the same filesystem.'''
+ tempFile = file+'vdsm_temp'
+ f = open(tempFile, 'w')
+ yield f
+ f.flush()
+ os.fsync(f.fileno())
+ f.close()
+ os.rename(tempFile, file)
--
To view, visit http://gerrit.ovirt.org/7656
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibecd61d6746231a5a8cb17bad9a3302b01454f27
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Antoni Segura Puimedon <asegurap(a)redhat.com>
Saggi Mizrahi has uploaded a new change for review.
Change subject: Add deathSignal options to better peopen
......................................................................
Add deathSignal options to better peopen
This allows VDSM to specify as signal that will be sent by the kernel to
the child when VDSM dies.
- Also fixes problem in the makefile that would cause make not to
recompile the SO when the C file was changed
Change-Id: I9f987129cea112e2a75d6f02477369417cc50dc7
Signed-off-by: Saggi Mizrahi <smizrahi(a)redhat.com>
---
M vdsm/betterPopen/Makefile.am
M vdsm/betterPopen/__init__.py
M vdsm/betterPopen/createprocess.c
3 files changed, 35 insertions(+), 5 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/41/6241/1
--
To view, visit http://gerrit.ovirt.org/6241
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I9f987129cea112e2a75d6f02477369417cc50dc7
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Saggi Mizrahi <smizrahi(a)redhat.com>
Ryan Harper has uploaded a new change for review.
Change subject: Add build-dep packages so yum-builddep is effective
......................................................................
Add build-dep packages so yum-builddep is effective
yum-builddep doesn't get all of the required packages
needed to build vdsm and vdsm rpms. Update the specfile
Build-Requires to include the needed packages.
Change-Id: Ia5b96b5b30a9efea06261f40d1f6df61754b8253
Signed-off-by: Ryan Harper <ryanh(a)us.ibm.com>
---
M vdsm.spec.in
1 file changed, 3 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/55/7955/1
diff --git a/vdsm.spec.in b/vdsm.spec.in
index 56a42b4..300dbe5 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -29,6 +29,9 @@
BuildRequires: pyflakes
BuildRequires: python-nose
BuildRequires: python-pep8
+BuildRequires: gcc
+BuildRequires: automake
+BuildRequires: rpm-build
# BuildRequires needed by the tests during the build
BuildRequires: python-ethtool
--
To view, visit http://gerrit.ovirt.org/7955
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia5b96b5b30a9efea06261f40d1f6df61754b8253
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ryan Harper <ryanh(a)us.ibm.com>
Shu Ming has uploaded a new change for review.
Change subject: Get oop from object instance
......................................................................
Get oop from object instance
In FileStorageDomain non-class method, self.oop should
be used instead of oop
Change-Id: Ia6b86f2c5e382774003772837e32bd62f8ad29ce
Signed-off-by: Shu Ming <shuming(a)linux.vnet.ibm.com>
---
M vdsm/storage/fileSD.py
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/20/8920/1
diff --git a/vdsm/storage/fileSD.py b/vdsm/storage/fileSD.py
index f92ed98..7d6e1ab 100644
--- a/vdsm/storage/fileSD.py
+++ b/vdsm/storage/fileSD.py
@@ -177,7 +177,7 @@
def getReadDelay(self):
t = time.time()
- oop.getProcessPool(self.sdUUID).directReadLines(self.metafile)
+ self.oop.getProcessPool(self.sdUUID).directReadLines(self.metafile)
return time.time() - t
def getFileList(self, pattern, caseSensitive):
--
To view, visit http://gerrit.ovirt.org/8920
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia6b86f2c5e382774003772837e32bd62f8ad29ce
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shu Ming <shuming(a)linux.vnet.ibm.com>