Sapan Bhatia [Wed, 28 Oct 2009 01:22:14 +0000 (01:22 +0000)]
New plugin for making vsys scripts PLC-controllable.
Barış Metin [Thu, 22 Oct 2009 09:13:40 +0000 (09:13 +0000)]
fix for syntax error
Setting tag NodeManager-1.8-18
--This line, and those below, will be ignored--
Please write a changelog for this new tag in the section above
DIFF=========
Index: tools.py
===================================================================
--- tools.py (.../tags/NodeManager-1.8-17) (révision 15402)
+++ tools.py (.../trunk) (révision 15402)
@@ -18,18 +18,21 @@
return interface
def get_hwaddr_from_plnode():
- for line in open("/usr/boot/plnode.txt", 'r').readlines():
- if line.startswith("NET_DEVICE"):
- return line.split("=")[1].strip().strip('"')
+ try:
+ for line in open("/usr/boot/plnode.txt", 'r').readlines():
+ if line.startswith("NET_DEVICE"):
+ return line.split("=")[1].strip().strip('"')
+ except:
+ pass
return None
def get_if_from_hwaddr(hwaddr):
- import sioc
- devs = sioc.gifconf()
- for dev in devs:
- dev_hwaddr = sioc.gifhwaddr(dev)
- if dev_hwaddr == hwaddr: return dev
- return None
+ import sioc
+ devs = sioc.gifconf()
+ for dev in devs:
+ dev_hwaddr = sioc.gifhwaddr(dev)
+ if dev_hwaddr == hwaddr: return dev
+ return None
def as_daemon_thread(run):
"""Call function <run> with no arguments in its own thread."""
Index: bwmon.py
===================================================================
--- bwmon.py (.../tags/NodeManager-1.8-17) (révision 15402)
+++ bwmon.py (.../trunk) (révision 15402)
@@ -324,7 +324,7 @@
(self.name,
bwlimit.format_tc_rate(maxrate),
bwlimit.format_tc_rate(maxi2rate)), 1)
- bwlimit.set(xid = self.xid, dev = dev_default
+ bwlimit.set(xid = self.xid, dev = dev_default,
minrate = self.MinRate * 1000,
maxrate = self.MaxRate * 1000,
maxexemptrate = self.Maxi2Rate * 1000,
Anil-Kumar Vengalil [Thu, 22 Oct 2009 07:39:05 +0000 (07:39 +0000)]
bug-fix
Barış Metin [Wed, 21 Oct 2009 15:42:34 +0000 (15:42 +0000)]
wrap open() with try/except
Anil-Kumar Vengalil [Wed, 21 Oct 2009 10:40:20 +0000 (10:40 +0000)]
Setting tag NodeManager-1.8-17
-fixed problem with sioc import at the build side
-bwlimit.set() now accepts the device and does not asume that it is eth0
Barış Metin [Wed, 21 Oct 2009 10:19:34 +0000 (10:19 +0000)]
import sioc only when needed.
Anil-Kumar Vengalil [Wed, 21 Oct 2009 10:15:07 +0000 (10:15 +0000)]
testing: this is to avoid building failing while building myplc-doc
Barış Metin [Tue, 20 Oct 2009 12:58:19 +0000 (12:58 +0000)]
- don't hardcode the device name (depends on util-vserver-pl change rev. 15385)
Setting tag NodeManager-1.8-16
--This line, and those below, will be ignored--
Please write a changelog for this new tag in the section above
DIFF=========
Index: tools.py
===================================================================
--- tools.py (.../tags/NodeManager-1.8-15) (révision 15386)
+++ tools.py (.../trunk) (révision 15386)
@@ -8,12 +8,31 @@
import threading
import fcntl
import commands
+import sioc
import logger
PID_FILE = '/var/run/nm.pid'
+def get_default_if():
+ interface = get_if_from_hwaddr(get_hwaddr_from_plnode())
+ if not interface: interface = "eth0"
+ return interface
+
+def get_hwaddr_from_plnode():
+ for line in open("/usr/boot/plnode.txt", 'r').readlines():
+ if line.startswith("NET_DEVICE"):
+ return line.split("=")[1].strip().strip('"')
+ return None
+
+def get_if_from_hwaddr(hwaddr):
+ devs = sioc.gifconf()
+ for dev in devs:
+ dev_hwaddr = sioc.gifhwaddr(dev)
+ if dev_hwaddr == hwaddr: return dev
+ return None
+
def as_daemon_thread(run):
"""Call function <run> with no arguments in its own thread."""
thr = threading.Thread(target=run)
Index: bwmon.py
===================================================================
--- bwmon.py (.../tags/NodeManager-1.8-15) (révision 15386)
+++ bwmon.py (.../trunk) (révision 15386)
@@ -52,8 +52,9 @@
seconds_per_day = 24 * 60 * 60
bits_per_byte = 8
+dev_default = tools.get_default_if()
# Burst to line rate (or node cap). Set by NM. in KBit/s
-default_MaxRate = int(bwlimit.get_bwcap() / 1000)
+default_MaxRate = int(bwlimit.get_bwcap(dev_default) / 1000)
default_Maxi2Rate = int(bwlimit.bwmax / 1000)
# 5.4 Gbyte per day. 5.4 * 1024 k * 1024M * 1024G
# 5.4 Gbyte per day max allowed transfered per recording period
@@ -323,7 +324,7 @@
(self.name,
bwlimit.format_tc_rate(maxrate),
bwlimit.format_tc_rate(maxi2rate)), 1)
- bwlimit.set(xid = self.xid,
+ bwlimit.set(xid = self.xid, dev = dev_default
minrate = self.MinRate * 1000,
maxrate = self.MaxRate * 1000,
maxexemptrate = self.Maxi2Rate * 1000,
@@ -704,7 +705,7 @@
nmdbcopy = copy.deepcopy(database.db)
database.db_lock.release()
try:
- if getDefaults(nmdbcopy) and len(bwlimit.tc("class show dev eth0")) > 0:
+ if getDefaults(nmdbcopy) and len(bwlimit.tc("class show dev %s" % dev_default)) > 0:
# class show to check if net:InitNodeLimit:bwlimit.init has run.
sync(nmdbcopy)
else: logger.log("bwmon: BW limits DISABLED.")
Index: net.py
===================================================================
--- net.py (.../tags/NodeManager-1.8-15) (révision 15386)
+++ net.py (.../trunk) (révision 15386)
@@ -11,8 +11,10 @@
import sioc, plnet
# local modules
-import bwlimit, logger, iptables
+import bwlimit, logger, iptables, tools
+dev_default = tools.get_default_if()
+
def start(options, conf):
logger.log("net plugin starting up...")
@@ -22,7 +24,7 @@
if 'OVERRIDES' in dir(config):
if config.OVERRIDES.get('net_max_rate') == '-1':
logger.log("net: Slice and node BW Limits disabled.")
- if len(bwlimit.tc("class show dev eth0")):
+ if len(bwlimit.tc("class show dev %s" % dev_default)):
logger.verbose("*** DISABLING NODE BW LIMITS ***")
bwlimit.stop()
else:
Index: plugins/rawdisk.py
===================================================================
--- plugins/rawdisk.py (.../tags/NodeManager-1.8-15) (révision 15386)
+++ plugins/rawdisk.py (.../trunk) (révision 15386)
@@ -39,7 +39,6 @@
break
buf = buf.strip()
fields = re.split(pat, buf)
- print fields
dev = fields[-1]
if not dev.startswith("dm-") and dev.endswith("1") and dev not in in_vg:
devices.append("/dev/%s" % dev)
Daniel Hokka Zakrisson [Fri, 16 Oct 2009 15:12:03 +0000 (15:12 +0000)]
Remove debugging statement.
Anil-Kumar Vengalil [Wed, 14 Oct 2009 09:23:51 +0000 (09:23 +0000)]
correcting file path
Barış Metin [Wed, 14 Oct 2009 09:03:16 +0000 (09:03 +0000)]
use dev_default for bwlimit.set()
Barış Metin [Wed, 14 Oct 2009 08:47:48 +0000 (08:47 +0000)]
don't hardcode the device name.
Marc Fiuczynski [Fri, 9 Oct 2009 15:43:24 +0000 (15:43 +0000)]
The seed for random previously was the meaning of life (i.e., 42) but
that resulted in a not so random choice for the hmac. This
implementation now uses a random.seed that is based on the current
time.
Setting tag NodeManager-1.8-15
Thierry Parmentelat [Fri, 9 Oct 2009 15:19:13 +0000 (15:19 +0000)]
typo
Marc Fiuczynski [Wed, 7 Oct 2009 21:47:54 +0000 (21:47 +0000)]
minor improvements with the hope that slivers across machines get different hmacs
Marc Fiuczynski [Tue, 6 Oct 2009 20:43:59 +0000 (20:43 +0000)]
Setting tag NodeManager-1.8-14
Minor fix such that sliverauth.py makes a more specific call to
GetSliceTags that include that specific tagname it is looking for.
Daniel Hokka Zakrisson [Sat, 26 Sep 2009 12:30:50 +0000 (12:30 +0000)]
Only get the hmac tag.
Stephen Soltesz [Sun, 20 Sep 2009 01:52:21 +0000 (01:52 +0000)]
Setting tag NodeManager-1.8-13
Fix bug that prevented 'OVERRIDES' for working correctly.
Stephen Soltesz [Sat, 19 Sep 2009 19:55:30 +0000 (19:55 +0000)]
fixing the logic for r14697 and adding a clarifying note.
Marc Fiuczynski [Sat, 19 Sep 2009 01:57:31 +0000 (01:57 +0000)]
Faiyaz Ahmed [Tue, 8 Sep 2009 20:14:03 +0000 (20:14 +0000)]
Setting tag NodeManager-1.8-12
Increase disk limits to 10G per sliver
Sanity check slice for home directory before starting (hack)
Check codemux arguments
Faiyaz Ahmed [Mon, 7 Sep 2009 19:10:31 +0000 (19:10 +0000)]
Increase disk limit.
Marc Fiuczynski [Thu, 13 Aug 2009 16:17:15 +0000 (16:17 +0000)]
Be a bit more robust to poorly defined codemux attribute values
Marc Fiuczynski [Thu, 13 Aug 2009 16:16:31 +0000 (16:16 +0000)]
clean up of the 'configure' method. Now provides more failure information
Faiyaz Ahmed [Thu, 6 Aug 2009 20:23:31 +0000 (20:23 +0000)]
Setting tag NodeManager-1.8-11
* Fix Delegation
* Move plcapi in plugin-api GetSlivers() calls.
* Persistent Authcheck and resync session when auth failure
Faiyaz Ahmed [Thu, 6 Aug 2009 20:21:20 +0000 (20:21 +0000)]
loop on authcheck code in case session is wrong AND api is unavailable.
Faiyaz Ahmed [Thu, 6 Aug 2009 16:35:33 +0000 (16:35 +0000)]
Change plugin API (GetSlivers()) argument order to avoid unnecessary PLCAPI dependency. Fixes Delegation.
Faiyaz Ahmed [Tue, 4 Aug 2009 17:09:41 +0000 (17:09 +0000)]
formatting
Faiyaz Ahmed [Tue, 4 Aug 2009 16:29:19 +0000 (16:29 +0000)]
Setting tag NodeManager-1.8-10
Disabling sliverauth module. Not ready for deployment.
Faiyaz Ahmed [Tue, 4 Aug 2009 16:27:18 +0000 (16:27 +0000)]
bump util-vserver-python requires. old util-vserver-python's paths are wrong.
Faiyaz Ahmed [Tue, 4 Aug 2009 16:18:44 +0000 (16:18 +0000)]
Disabling sliverauth
Faiyaz Ahmed [Mon, 3 Aug 2009 21:35:17 +0000 (21:35 +0000)]
Setting tag NodeManager-1.8-9
Fixing overrides semantics.
Faiyaz Ahmed [Mon, 3 Aug 2009 21:31:26 +0000 (21:31 +0000)]
Fix overrides to clean out when none present.
Faiyaz Ahmed [Mon, 3 Aug 2009 20:57:44 +0000 (20:57 +0000)]
Setting tag NodeManager-1.8-8
Generalized plugins
Fixed initscript start up bug.
Faiyaz Ahmed [Mon, 3 Aug 2009 20:55:38 +0000 (20:55 +0000)]
Rearranging and moving trunk to 1.8.
Faiyaz Ahmed [Mon, 3 Aug 2009 20:45:56 +0000 (20:45 +0000)]
NM does not fork often. A stack limit is now unnecessary.
This fixes the crond bug inside slivers.
Marc Fiuczynski [Tue, 21 Jul 2009 18:50:24 +0000 (18:50 +0000)]
cleanup: use os.path.join
Daniel Hokka Zakrisson [Mon, 20 Jul 2009 23:28:12 +0000 (23:28 +0000)]
Tabs vs. spaces.
Marc Fiuczynski [Fri, 17 Jul 2009 04:05:35 +0000 (04:05 +0000)]
use a temp file to write the keys
Marc Fiuczynski [Fri, 17 Jul 2009 04:04:01 +0000 (04:04 +0000)]
only copy in the /dev/sd* file if its not there
Marc Fiuczynski [Thu, 16 Jul 2009 21:23:49 +0000 (21:23 +0000)]
NodeManager plugin to empower slivers to make API calls.
Marc Fiuczynski [Thu, 16 Jul 2009 21:23:14 +0000 (21:23 +0000)]
NodeManager plugin to support mapping unused raw disks into a slice
that has the rawdisk sliver tag.
Marc Fiuczynski [Thu, 16 Jul 2009 19:53:42 +0000 (19:53 +0000)]
NM plugin to pull down special account keys: specifically site_admin and root
Marc Fiuczynski [Wed, 15 Jul 2009 13:35:12 +0000 (13:35 +0000)]
Need to use , rather than / as the sed separator
Faiyaz Ahmed [Tue, 14 Jul 2009 18:21:45 +0000 (18:21 +0000)]
Syntax error in overrides
Marc Fiuczynski [Thu, 9 Jul 2009 02:27:34 +0000 (02:27 +0000)]
sync up with what's on the branch
Marc Fiuczynski [Tue, 7 Jul 2009 22:00:38 +0000 (22:00 +0000)]
as a plugin, be more verbose about when they are started
Marc Fiuczynski [Tue, 7 Jul 2009 21:58:00 +0000 (21:58 +0000)]
- change so that NodeManager/plugins are always loaded, as that's
where codemux & vsys live
Marc Fiuczynski [Tue, 7 Jul 2009 21:50:08 +0000 (21:50 +0000)]
net.py is a 'required' 'plugin' module similar to conf_files.py, bwmon.py, and sm.py
Marc Fiuczynski [Tue, 7 Jul 2009 21:10:06 +0000 (21:10 +0000)]
Change local GetSlivers() callbacks to take args as (plc,data,config)
Marc Fiuczynski [Tue, 7 Jul 2009 20:32:36 +0000 (20:32 +0000)]
- turn net.py into a NM plugin and move to plugin directory
- pass plc, data, and config to each plugin
Faiyaz Ahmed [Mon, 6 Jul 2009 21:13:18 +0000 (21:13 +0000)]
Call to get whole record, not just tags.
Faiyaz Ahmed [Mon, 6 Jul 2009 16:37:40 +0000 (16:37 +0000)]
Get slice tags from within sliver using nm api.
Faiyaz Ahmed [Mon, 29 Jun 2009 20:48:28 +0000 (20:48 +0000)]
* give all modules access to the API and to the config class
* Fix delegation
* codemux can be disabled using the _default slice
Faiyaz Ahmed [Fri, 26 Jun 2009 18:33:58 +0000 (18:33 +0000)]
Rerun start up scripts after re-enable.
Faiyaz Ahmed [Thu, 4 Jun 2009 18:59:53 +0000 (18:59 +0000)]
Updated bw limits
Faiyaz Ahmed [Mon, 1 Jun 2009 20:12:40 +0000 (20:12 +0000)]
Double bw limits.
Faiyaz Ahmed [Tue, 26 May 2009 18:46:00 +0000 (18:46 +0000)]
attributes are now tagnames. Also move debugging output to statements before places where data is used.
Marc Fiuczynski [Wed, 20 May 2009 13:24:38 +0000 (13:24 +0000)]
clean up .ssh/authorized_keys setup for slices
Barış Metin [Mon, 6 Apr 2009 10:18:22 +0000 (10:18 +0000)]
guard AuthCheck with try/except as it will raise an exception.
Barış Metin [Mon, 6 Apr 2009 09:46:34 +0000 (09:46 +0000)]
if authentication with the session fails try authenticating with hmac
to get a new session.
Faiyaz Ahmed [Wed, 1 Apr 2009 17:44:55 +0000 (17:44 +0000)]
Use log_call instead of os.system().
Faiyaz Ahmed [Fri, 27 Mar 2009 19:50:29 +0000 (19:50 +0000)]
change from call()/check_call to Popen() in log_exec. This will raise and log an exception when spawned processes barf. nm.daemon should now be empty :-D
Faiyaz Ahmed [Tue, 24 Mar 2009 21:25:09 +0000 (21:25 +0000)]
Branch 1.9 for module NodeManager created (as new trunk) from tag NodeManager-1.8-1
Faiyaz Ahmed [Tue, 24 Mar 2009 21:24:40 +0000 (21:24 +0000)]
Tagging module NodeManager - NodeManager-1.8-1
Faiyaz Ahmed [Tue, 24 Mar 2009 19:47:07 +0000 (19:47 +0000)]
Merge from Branch.
Faiyaz Ahmed [Mon, 16 Feb 2009 20:14:44 +0000 (20:14 +0000)]
Merge from branch.
* Changes delegate class to controller
* Adds ability to disable HTBs
* fixes bug in nm.py when API is unavailable.
* adds sysctl slice attribute
Faiyaz Ahmed [Thu, 22 Jan 2009 18:42:17 +0000 (18:42 +0000)]
Can disable slice HTB's via PLC_SlICE_PREFIX+_default: sliceattribute net_max_rate=-1
Thierry Parmentelat [Mon, 15 Dec 2008 13:05:23 +0000 (13:05 +0000)]
always store latest data from GetSlivers in /var/log/getslivers.txt, not only when verbose
Daniel Hokka Zakrisson [Wed, 3 Dec 2008 17:36:30 +0000 (17:36 +0000)]
Use pyplnet.
Daniel Hokka Zakrisson [Tue, 2 Dec 2008 03:44:49 +0000 (03:44 +0000)]
Use codemux condrestart.
Thierry Parmentelat [Fri, 28 Nov 2008 14:36:02 +0000 (14:36 +0000)]
renaming SliceAttribute into SliceTag and InterfaceSetting into InterfaceTag
Faiyaz Ahmed [Thu, 27 Nov 2008 22:19:56 +0000 (22:19 +0000)]
Merge changes that existed only in the branch.
Faiyaz Ahmed [Tue, 25 Nov 2008 19:30:43 +0000 (19:30 +0000)]
Merge changes that existed in branch concerning slicefamily w/ trunk.
Also changed logging in 1.7 branch to be less noisey.
Removed support for proper.
Faiyaz Ahmed [Tue, 25 Nov 2008 19:27:37 +0000 (19:27 +0000)]
Change logging to be quieter
Thierry Parmentelat [Sat, 22 Nov 2008 08:42:14 +0000 (08:42 +0000)]
fix build
Faiyaz Ahmed [Fri, 21 Nov 2008 21:32:53 +0000 (21:32 +0000)]
Plugins directory.
Daniel Hokka Zakrisson [Fri, 21 Nov 2008 15:51:57 +0000 (15:51 +0000)]
The proper module no longer exists.
Faiyaz Ahmed [Tue, 18 Nov 2008 22:01:14 +0000 (22:01 +0000)]
Verbose logging. \nMoved semaphore out of worker class.
Faiyaz Ahmed [Tue, 18 Nov 2008 21:58:48 +0000 (21:58 +0000)]
Added method to verify if controller account is setup.
Faiyaz Ahmed [Tue, 18 Nov 2008 21:58:25 +0000 (21:58 +0000)]
Ensure delegated slivers have their info synced with PLC after ticket is delivered.
Faiyaz Ahmed [Tue, 18 Nov 2008 19:35:05 +0000 (19:35 +0000)]
changed nm controller type.
Marc Fiuczynski [Mon, 17 Nov 2008 16:51:56 +0000 (16:51 +0000)]
merge changes to set_resources() from branch to trunk
Faiyaz Ahmed [Fri, 14 Nov 2008 22:11:18 +0000 (22:11 +0000)]
Change to Controller from Delegate shell
Faiyaz Ahmed [Fri, 14 Nov 2008 21:16:05 +0000 (21:16 +0000)]
NM-controller accounts != delegate accounts. Nomenclature change. purely cosmetic.
Faiyaz Ahmed [Wed, 12 Nov 2008 21:05:31 +0000 (21:05 +0000)]
Slices can call recreate on themselves regardless of instantiation.
Calling create/destroy on a PLC slice results in an error.
White space changes.
Faiyaz Ahmed [Wed, 12 Nov 2008 19:19:20 +0000 (19:19 +0000)]
ReCreate is NOT an anonymous call.
Faiyaz Ahmed [Tue, 11 Nov 2008 22:23:05 +0000 (22:23 +0000)]
Syntax error in permission checking for genicw.
Faiyaz Ahmed [Mon, 10 Nov 2008 20:45:25 +0000 (20:45 +0000)]
bug in matching MAC addr with nodenetworks mac addr.
Faiyaz Ahmed [Mon, 10 Nov 2008 19:00:28 +0000 (19:00 +0000)]
Keep rspecs for delegated slices in sync w/ PLC
Faiyaz Ahmed [Thu, 6 Nov 2008 22:26:03 +0000 (22:26 +0000)]
Rough draft to support admin tickets from "blessed" interfaces.
Faiyaz Ahmed [Wed, 8 Oct 2008 14:55:42 +0000 (14:55 +0000)]
Syntax error
Faiyaz Ahmed [Mon, 6 Oct 2008 16:29:14 +0000 (16:29 +0000)]
Untested
Faiyaz Ahmed [Mon, 22 Sep 2008 17:41:50 +0000 (17:41 +0000)]
Another optimization. Bringing us closer to generic support for cliques
Faiyaz Ahmed [Fri, 19 Sep 2008 19:06:20 +0000 (19:06 +0000)]
Check for the existence of the Internet2 clique iptables rule and add if absent.
Faiyaz Ahmed [Wed, 17 Sep 2008 18:24:34 +0000 (18:24 +0000)]
Clique network shares don't exist yet.
Faiyaz Ahmed [Wed, 10 Sep 2008 20:34:33 +0000 (20:34 +0000)]
Move checks from bwmon for running limits before calling bwlimit.
Faiyaz Ahmed [Tue, 9 Sep 2008 16:47:50 +0000 (16:47 +0000)]
* Explicitly run configure, which sets capabilities and resources, before starting vserver.
* Print username when NM api returns permission denied.
Faiyaz Ahmed [Wed, 3 Sep 2008 20:57:20 +0000 (20:57 +0000)]
enable disable flag.
Thierry Parmentelat [Mon, 1 Sep 2008 15:04:27 +0000 (15:04 +0000)]
from branch