[Planetlab-devel] node manager

Daniel Hokka Zakrisson dhokka at CS.Princeton.EDU
Wed Dec 12 05:20:11 EST 2007


Hi Thierry,

Quoting Thierry Parmentelat <thierry.parmentelat at sophia.inria.fr>:
> Daniel Hokka Zakrisson wrote:
>> Hi Thierry,
>>
>> Quoting Thierry Parmentelat <thierry.parmentelat at sophia.inria.fr>:
>>> I'm moving here the thread that started on the cvs ml
>>>
>>> The issues I have with nm are as follows - from this list you'll 
>>> see that i could use some help :-)
>>>
>>> - when I started digging yesterday, the external symptom was that 
>>> slices did not get created; at least i cound not enter the node 
>>> through ssh
>>>
>>> - there was a lot of issues related to conf_files, so upon faiyaz's 
>>> suggestion, and in an attempt to focus on slice creation, I have 
>>> commented out all modules but 'sm' in nm.py
>>>
>>> - I had made the indentation change because I was seing this kind 
>>> of messages which suggested there was something wrong with calling 
>>> set_ipaddresses_config. I haven't committed that back yet, but here 
>>> is what I now getting with the original version
>>>
>>> Tue Dec 11 14:41:53 2007: operation on ts_slicetest1 failed. 
>>> Traceback (most recent call last):
>>>  File "/usr/share/NodeManager/accounts.py", line 168, in _run
>>>    cmd[0](*cmd[1:])
>>>  File "/usr/share/NodeManager/accounts.py", line 129, in _ensure_created
>>>    if not isinstance(self._acct, next_class): self._acct = next_class(rec)
>>>  File "/usr/share/NodeManager/sliver_vs.py", line 65, in __init__
>>>    self.configure(rec)
>>>  File "/usr/share/NodeManager/sliver_vs.py", line 83, in configure
>>>    self.set_resources()
>>>  File "/usr/share/NodeManager/sliver_vs.py", line 175, in set_resources
>>>    self.set_ipaddresses_config(self.rspec['ip_addresses'])
>>>  File "/usr/lib/python2.5/site-packages/vserver.py", line 230, in 
>>> set_ipaddresses_config
>>>    self.set_ipaddresses(addresses)
>>>  File "/usr/lib/python2.5/site-packages/vserver.py", line 219, in 
>>> set_ipaddresses
>>>    vserverimpl.netremove(self.ctx, "all")
>>> OSError: [Errno -22] Unknown error 4294967274
>>>
>>> and I have no clue what this -22 error actually means
>>
>> EINVAL. Would be interesting to know what causes it, i.e. if it's 
>> the kernel or userspace.
> IMHO, the issue is when vserver_net_remove calls get_mask
> in our case, ip is "all" so we've just set addr.vna_type to 
> VC_NXA_TYPE_ANY - which is 0xff
> and get_mask checks for this value to be exactly 0x01 or 0x02
>
> unless I got it wrong again, that is..

Whoops, you're right of course. That must've gotten messed up in the 
reorganization. I've moved the get_mask block into the address branch, 
where it belongs.

> btw: what's behind this idea of setting errno to a negative value ? 
> that was confusing as well...

Too much kernel code for me...

Daniel

> - Thierry
>
> =====
> static PyObject *
> vserver_net_remove(PyObject *self, PyObject *args)
> {
>  struct vc_net_addr addr;
>  nid_t nid;
>  const char *ip;
>
>  if (!PyArg_ParseTuple(args, "Is", &nid, &ip))
>    return NULL;
>
>  if (strcmp(ip, "all") == 0)
>    addr.vna_type = VC_NXA_TYPE_ANY;
>  else if (strcmp(ip, "all4") == 0)
>    addr.vna_type = VC_NXA_TYPE_IPV4 | VC_NXA_TYPE_ANY;
>  else if (strcmp(ip, "all6") == 0)
>    addr.vna_type = VC_NXA_TYPE_IPV6 | VC_NXA_TYPE_ANY;
>  else {
>    if (convert_address(ip, &addr) == -1)
>      return PyErr_Format(PyExc_ValueError, "%s is not a valid IP 
> address", ip);
>    addr.vna_type |= VC_NXA_TYPE_ADDR;
>  }
>
>  switch (get_mask(&addr)) {
>  case -1:
>    return PyErr_SetFromErrno(PyExc_OSError);
>  }
> ...
>
> ===
> static int
> get_mask(struct vc_net_addr *addr)
> {
>  struct ifaddrs *head, *ifa;
>  int ret = 0;
>  int family, offset, len;
>  void *ip;
>
>  switch (addr->vna_type) {
>  case VC_NXA_TYPE_IPV4:
>    family = AF_INET;
>    offset = offsetof(struct sockaddr_in,  sin_addr.s_addr);
>    ip = &addr->vna_v4_ip.s_addr;
>    len = 4;
>    addr->vna_v4_mask.s_addr = htonl(0xffffff00);
>    addr->vna_prefix = 24;
>    break;
>  case VC_NXA_TYPE_IPV6:
>    family = AF_INET6;
>    offset = offsetof(struct sockaddr_in6, sin6_addr.s6_addr);
>    ip = addr->vna_v6_ip.s6_addr;
>    len = 16;
>    addr->vna_v6_mask.s6_addr32[9] = addr->vna_v6_mask.s6_addr32[1] = 
> 0xffffffff;
>    addr->vna_v6_mask.s6_addr32[2] = addr->vna_v6_mask.s6_addr32[3] = 
> 0x00000000;
>    addr->vna_prefix = 64;
>    break;
>  default:
>    errno = -EINVAL;
>    return -1;
>  }
> ...
> =====
> #define VC_NXA_TYPE_IPV4                0x0001
> #define VC_NXA_TYPE_IPV6                0x0002
> #define VC_NXA_TYPE_ANY                 0x00FF
>
> _______________________________________________
> Devel mailing list
> Devel at lists.planet-lab.org
> https://lists.planet-lab.org/mailman/listinfo/devel
>





More information about the Devel mailing list