Friday, January 28, 2011

ethtool, WOL: What does "wake on physical activity" actually mean and (how) can I use it?

Hi everyone.

I fighting with the WOL settings of my Ubuntu box at the moment. The idea is to have an HTTP/SVN server to sleep while it's unused and wake up when it's accessed. So far, wake-on-LAN works and is activated on startup:

Settings for eth1:
        Supported ports: [ TP ]
        Supported link modes:   10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Full
        Supports auto-negotiation: Yes
        Advertised link modes:  Not reported
        Advertised pause frame use: No
        Advertised auto-negotiation: Yes
        Speed: 1000Mb/s
        Duplex: Full
        Port: Twisted Pair
        PHYAD: 0
        Transceiver: internal
        Auto-negotiation: on
        MDI-X: Unknown
        Supports Wake-on: pg
        Wake-on: pg
        Current message level: 0x0000003f (63)
        Link detected: yes

As you can see, I also set the wol p flag ('wake on physical activity'). My assumption was that I could convince the device to wake up not only on magic packets, but on any network access. This, however, seems to be wrong.

What does this flag mean then, and: (How) can I misuse this for my evil plans?

-- Markus (cross-post)

  • WOL typically requires a "magic packet" to actually "wake-up" a WOL system when it is "sleeping" or in an "off" state. The "magic packet" is a specific "message" instead of just any casual network activity.

    Some NICs have advanced power management features where it can "wake" a system based on network activity, but like WOL not all models necessarily have this capability.

    From

Using the free space on an ESXi datastore with an existing Centos VM of limited size

I have ESXi 4 on a home-built server with a 925GB RAID5 array (adaptec 2405 card) with a single Centos5.4 VM running on it. The VM has a provisioned size of 20GB which I can't seem to increase using the vSphere client. Now I would like to either increase the size of the Centos VM to use more of the free space or I would like to somehow use the datastore as another volume that can be easily accessed from the Centos VM. Does anyone know how to achieve this? Thanks.

  • What have you tried from the vSphere client?

    Is the virtual machine powered off? Are there any snapshots on the virtual machine?

    The machine needs to be powered off and without snapshots before resizing the drive. After you resize the virtual disk you can use gParted and/or LVM tools to resize the partition.

    From andyh_ky

Need help movig DNS providers (ZoneEdit to DynDNS)

I have a domain name and I use GoDaddy as my registar. My DNS provider is ZoneEdit. I'm staying with GoDaddy as my registrar, for now, but I want to switch DNS providers to DnynDNS. I already purchased an account with DynDNS.

In the process of switching, I want to avoid any downtime, especially when it comes to email (MX records). I'm a bit nervous and I want to double check with someone who has done something like this before that I'm doing things right. I'm especially interested in someone familiar with DynDNS and Google Apps which is where I host my e-mail. I'm somewhat confused by the priority settings for MX records. Also, do you suggest simply going to GoDaddy and changing my settings to point to DynDNS or should I do something else to avoid downtime?

Could you make sure that what I have with ZoneEdit: alt text

Here is what I have entered into DynDNS: alt text

Thanks!

    1. Why is the TTL for your A records only 60 seconds? Make them 3600 seconds like the rest of your DNS records. There's no valid reason to have the TTL so short.

    2. Is your domain name a secret? Why black it out? Do you think it's some kind of security risk to let us see what your domain name is?

    3. The records you have setup at DynDNS look fine to me (except for the aforementioned TTL of the A records), although I would suggest setting the MX priority to be the same as it's currently set up.

    andresmh : Not sure why only 60 seconds. Is it just adding extra pressure to the DNS server?
    From joeqwerty
  • DNS MX record priorities are really just what they sound like. You give each record a priority (the lower the number the higher the priority) and in theory mail servers try the highest priority record first, and if it doesn't respond they try the next one, etc.

    I'm a little unsure why you've got records listed from 10 to 70, have a look at this for the relative priorities between the servers - http://www.google.com/support/a/bin/answer.py?answer=174125

    If Zoneedit and Dyn will both be hosting your DNS records (at least for the immediate future) you should be fine, just change the name server delegation at Godaddy and after a while (depending how often the root reloads) you'll see queries will start using the Dyn DNS servers.

    It's one of those things that seems a lot scarier than it actually is so long as you do it right.

    andresmh : thanks for the link to google,the priorities I had were values that I had gotten from some other google FAQ, weird that they suggest such diversity of values.
    From Hutch

kernel software trap handling

I'm reading a book on Windows Internals and there's something I don't understand:

"The kernel handles software interrupts either as part of hardware interrupt handling or synchronously when a thread invokes kernel functions related to the software interrupt."

So does this mean that software interrupts or exceptions will only be handled under these conditions:

a. When the kernel is executing a function from said thread related to the software exception(trap) b. when it is already handling a hardware trap

Is my understanding of this correct?

The next bit:

"In most cases, the kernel installs front-end trap handling functions that perform general trap handling tasks before and after transferring control to other functions that field the trap."

I don't quite understand what it means by 'front-end trap handling functions' and 'field the trap'?

Can anyone help me?

  • This smells like homework, but I'll take a stab at it.

    What it sounds like to me is it is saying that software interrupts (which are not the same as exceptions, perhaps!) at non-deterministic times. Basically, the OS wants to be efficient, and may handle them as part of another interrupt (hardware it seems) or when you enter kernel space (say, make a kernel request.)

    As for the front-end trap handling, that's more or less saying that the kernel gets a shot before and after each trap that is handled. For instance, some are not able to be passed on to user code no matter how hard you try. The kernel just handles it and never lets user code touch it. Others might be as simple as setting up a different stack to handle the interrupt, then letting user code take a stab at it. If none of the user-level code handles it, then it will eventually take some default action.

    Tony : This is not homework. Doing a self study.
    Michael Graff : No, I mean it sounds like homework I've had in my past :)
  • To me, it seems to be saying that software interrupts are handled either A) in the same part of kernel code as hardware interrupts, or B) the kernel doesn't do anything at the moment when the software interrupt occurs, but will remember that the interrupt occurred, and when a function related to the software interrupt is called, will handle the interrupt then.

    Windows has something called "Deferred Procedure Call" (DPC) where the bulk of interrupt processing is deferred until a convenient time. It does this because x86 CPU's only have one IRQ line that is multiplexed by an external PIC or APIC. When an IRQ is triggered, the CPU automatically disables IRQs until the interrupt service routine reenables them. But since there is only one IRQ line, that means when IRQs are disabled, that means all IRQs are disabled. x86 architecture has a lot of devices using IRQs so that means, really, that the system (or at least that particular CPU) is sort of held hostage during the time IRQs are disabled. Thus, the DPC mechanism exists to ensure that IRQs are turned off for the least time necessary. The ideal thing is for the ISR to do the absolute minimum processing necessary before reenabling IRQs and shift the rest of the work to a DPC.

    I could be wrong, but I think software interrupts disable IRQs automatically as well. So even though a software interrupt doesn't have I/O to service, it's still causing the system/single CPU to not be able service other interrupts until the interrupt handler reenables them.

    System calls using the assembly language INT instruction are software interrupts (unless Windows uses a different method now like Linux with it's linux-gate.so trick), as well as CPU exceptions including page faults, divide by zero,

    So all interrupts are handled asychronously in Windows and any operating system really, I think, for the above reasons. I'm not a kernel expert or anything so just take the above as some insight.

Openvz IPV6 Question

Hi

Is it possible to assign a /64 range of ipv6 ips to an openvz container?

  • That's certainly possible - why should it not? T

    he next question might be whether there would be autoconfiguration for the virtual machines. Leaving aside the fact that you shouldn't be using autoconfiguration for server machines: whether it would work depends on whether you use venet or veth. With veth, each VM has an ethernet address, and you can run radvd in the container. With venet, stateless autoconfiguration will not work, but explicitly assigned addresses will.

    My recommended configuration is to assign :: to each VM, assuming they are all dual-stack.

IPv6 in a Windows XP/Windows 2003 Network

Has anyone successfully deployed an IPv6 network in an environment with Windows XP SP3 workstations and Windows 2003 R2 servers? Are there any operating system issues one needs to consider? Does the windows firewall still work under Windows XP?

  • Despite Juliano's observation, I answer the first question with "yes": I have done so. In XP and W2k3R2, there are certainly still IPv6 issues. For example, the DNS server support is limited (it supports the records, but not in the "nice" way in which W2k8 does it). The biggest problem is that RDP still doesn't use IPv6, so Linux RDP clients often fail to connect (especially over SSH tunnels). The firewall works fine, AFAIK.

IPV6 testing for embedded devices

I would like to test the IPV6 stack on an embedded system. How can I do that ? Would establishing a test link between this device and another PC be a "good enough" test ?

I was thinking about using a tool like socat to establish the link.

Should I ask this here or on stackoverflow ?

  • Depends on the reason for performing the test. If you want to know whether the device can provide a certain function, you should test whether that function actually works. If the function is "can establish IPv6 TCP connections", then this is what you should test - connecting to a PC would then be good enough.

    If you want to certify IPv6 support for the device, this test certainly wouldn't be sufficient. There are feature lists for IPv6 tests that are used in certification, e.g. the IPv6 Ready Logo.