Older blog entries for etbe (starting at number 92)

Translation

I’ve created a page about translating my blog. Currently it has the following text:

If you would like to translate any posts from my blog to a language other than English then please feel free to do so. I demand that any translations correctly cite me as the author of the original English version and give a permanent link to the original post, but I don’t expect that this will cause any inconvenience.

I also request that anyone who translates one of my posts gives me permission to do whatever I wish with the translated text (I want to mirror all translations of my work on my own site). I am unsure of what legal rights I have to demand this and have not yet considered whether I have a moral right to demand it. But I believe that it is the nice thing for a translator to do and hope that everyone who translates one of my posts will do so.

Also I may grant permission for translations of my posts to appear on sites with Google advertising or other commercial use. I won’t rule out the possibility of assigning monopoly rights on commercial use of the translations of my posts to specific individuals or organisations.

Does anyone have suggestions for improvements?

One of my multi-lingual friends suggested that I should be concerned about the risk of bad translations. But I desire to have people read my posts and I believe that this is a risk I just have to accept - I’m sure that there are enough multi-lingual people in the blog space to find such errors and help the translator correct them.

Also I have to consider the best way to mirror the translations. I could add them to the same permalink page (producing long pages with multiple translations of my best posts), I could create a new post (resulting in English-language Planet installations getting posts that most people can’t read), or I could use a separate blog installation for the translations.

Please comment if you have any suggestions. I’ll write another post in future with the solutions that I select and some analysis of the issues.

Share This

Syndicated 2007-08-06 21:00:41 from etbe

Housing Prices

The Sydney Morning Herald has an article about pre-fabricated houses from Ikea and suggests that they could solve the housing price problems. The article states that in the UK the pre-fab houses would be more than 25% cheaper than regular houses in the UK.

Let’s assume for the sake of discussion that the introduction of Ikea pre-fabricated houses in the Australian market (which they currently don’t plan to do) will reduce house prices by 25%. This won’t solve the problem. According to the Australian Bureau of Statistics in 2006 the median income for males was $600-799 and for females was $250-399. A couple who are both at the high-end of that scale would gross $1200 per week, this would possibly allow them to pay $1600 per month towards a mortgage, if they were in the middle of that scale then they would gross $1000 per week which might allow paying $1000 per month towards a mortgage. With current interest rates that would make any mortgage greater than $200K unreasonably difficult for a couple at the high end of the median income range to repay and a mortgage greater than $120K would be unreasonably difficult for a couple in the middle of the range.

The ABS median house prices show that the cheapest places to buy houses in 2005 were Adelaide, Hobart, and Darwin with median prices of $208K, $209K, and $216K respectively. So a couple who are both at the high end of the median income range can only afford to buy a house in the three cheapest cities in Australia (which are also not densly populated). The two largest cities are Sydney and Melbourne which had median house prices of $363K and $300K respectively, they would not be affordable to a couple who are anywhere near the median income - not even with a 25% reduction in price!

I believe that people on a median income should be able to afford a median prices house - the majority of Australian families should be able to afford the majority of houses!

The above analysis only covers families wanting to purchase a house with two incomes. The “traditional” Australian idea of having the man earn the majority of all the money that is required while his wife looks after the children (which is a bad thing for other reasons) is obviously dead. A man who earns 50% more than the median income will have trouble paying for a house while supporting children if his wife doesn’t also work. It is generally accepted that anyone who doesn’t purchase a house before having children will never own a house. It seems strange that the major political parties talk about wanting to support families and to support “the Aussie battler”, but won’t do anything serious about house prices (which is the most significant issue for such people). Giving a first home owners grant of $7000 (which is less than 3% of the required money).

One possible way of alleviating this problem would be to remove Negative Gearing (or at least modifying it to encourage construction rather than buying existing properties). Then the price of properties that are rented out would reflect the rent value instead of being significantly over-priced.

Another possibility would be to make public transport more efficient and with a wider scope. The desirability of a location is to a large extent determined by how much time/money/effort is required to get to the centre of the nearest city for work. Making the mass public transport support larger numbers of people (by larger and more frequent trains, trams, and buses), have shorter journeys (by a more frequent service to reduce waiting and express and connecting services where possible), and more routes (by building new train or tram lines every time a new major road is built) would significantly increase the desirability of properties that are further from the centre of cities. That would decrease the market pressure on prices of properties that are a currently 30 minutes or one hour travel from the centre. It would also be a significant benefit if people who currently spend 30 minutes commuting could spend only 20.

If public transport was improved and negative gearing was abolished then I expect that there would be increased demand for new houses that are further away from city centres, and that pre-fabricated houses would make a significant difference in the price. But while the majority of the value of a house is contained in the land that it rests on I can’t see that making a difference.

Share This

Syndicated 2007-08-06 09:00:02 from etbe

Real Servers vs White-Box

Many people think that white-box machines (IE the cheapest no-nam PCs you can buy) are suitable for use as servers. There are several factors that make white-box machines totally unsuitable for use as a server (and IMHO unsuitable for any other task).

Firstly white-box machines are not designed. A set of parts are designed, some combinations of parts are tested, but most aren’t. For example a motherboard manufacturer will test their latest motherboard design with the current video cards and a video card manufacturer will test their new cardss with current motherboards. If you have a new video card and a new motherboard then there has probably been little testing of the combination. This compares to a name-brand machine where the entire unit has been tested and found to work together.

White-box assemblers (they aren’t “designed” or “manufactured”) will often use different combinations of parts for each machine that they assemble. If a video card manufacturer sells two cards with the same part number that have different chips then they may be installed in two machines with the same description. So taking an image of one white-box machine and installing it on another that was described as being identical might not work.

For these reasons I have ceased using white-box machines as desktop machines or as low-end servers (EG internet gateway machines). I use second-hand name-brand machines for low end servers and for desktop machines.

When comparing servers the case for name-brand systems is even stronger. Real servers have ECC RAM as a standard feature, it is possible to get white-box servers with ECC RAM - I have seen such a machine on one occasion. But the vast majority of white-box machines lack such features. See my previous posts about getting ECC RAM in a cheap machine and desktop machines with ECC RAM about some of the issues in this regard.

Another feature of servers is better storage options. There are white-box server machines with hot-swap hard drives, but they are significantly more expensive than regular white-box machines - if you are going to spend that much money then it’s better to get a refurbished HP server machine at auction (HP seems to be selling a lot of almost-new server gear at auction at quite reasonable prices with warrantee). A cheap machine (typical white-box or a very low end server from a company such as HP) will have hard drives that don’t support hot-swap. Lack of hot-swap means that a hard drive failure requires that the machine be disassembled to swap the dead disk - it also means that there is sometimes difficulty in identifying which disk has the problem (the error light on a hot-swap drive is quite handy). Then the process of swapping the disk will take at least 10 minutes of hardware work before the machine can be booted up again. With hot-swap disks you can identify the failed disk via a flashing light, remove it while the server is still running, and then initiate a RAID rebuild after installing the new disk. Hot-swap disks cost more and the mounting brackets etc are also expensive, but it’s a good option to have - especially considering that disks are more likely to fail at busy times which is when down-time is least acceptable. These features make disk expansion particularly expensive for servers, people often miss the benefits of servers and say “I just bought a 3000G disk for my home PC for $2, why can’t you just do the same for the server” (I am exaggerating slightly).

Another advantage of name-brand servers is remote access. There have been a variety of remote access cards that you could install in a white-box PC and also a variety of devices to digitise a VGA signal for remote KVM access, but they are all rather expensive and remove the price advantage of white-box hardware.

A final benefit of name-brand hardware is that you will be running the same hardware as other people. If I was to experience a problem running Linux on a HP DL380 G4 server then I can enter that text in to Google and get many hits. If I was to experience a similar problem with a white-box machine then I would need to perform searches on each of the parts that might have a problem - which would be particularly inconvenient if I couldn’t determine some of the part numbers through software and needed to disassemble the machine first!

Share This

Syndicated 2007-08-05 21:00:34 from etbe

Living in Hotels

I received a private email in response to my post about getting work in another country regarding hotel prices in London. The person who sent me the message had considered London but ended up moving to Japan instead partly due to living expenses (although Japan seems unlikely to be much cheaper).

The first issue concerns security of hotels. When living in hotels (for almost a year in London and about 6 months in the Netherlands there were a few occasions (IE one brief occasion every 4+ months) when I left my laptop under my bed at a hotel, but almost all the time I took it with me. At that time I aimed to have a minimal set of luggage, one large suitcase containing clothes, books, etc (things that are generally not worth stealing) and one small case containing my laptop, digital camera, passport, and other small things that are valuable or which would cause excessive inconvenience if I lost them. Also in the small case I would take fragile items. Then when leaving my hotel I would pack most of the items from the small suitcase (pretty much everything apart from the digital camera) into my laptop bag and take it with me. This limited my losses from hotel thieves to a digital camera (no incriminating pictures and I could always buy a better one) and a couple of bottles of liquor.

Good hotels have a hotel safe which you can use. But for a cheap (affordable) hotel there is no such option.

Hotels in London ARE expensive, but if you are prepared to lower you standard of living they aren’t too expensive. One thing to note about UK hotels is that the idea of having a toilet and shower in every room is a new concept and all the cheaper hotels lack this. It’s a standard feature for a hotel to have a wash-basin in every room, a toilet is optional, and a bath or shower is another option. There are various types of shared bathroom in UK hotels. The better ones vaguely resemble the facilities you might expect to find at a public swimming pool (large spaces, clean tiles everywhere, and a changing area in addition to the toilet and shower cubicles). The worst ones are basically what you might expect to see in a private home but with less cleaning.

To get the best deals on small hotels in London you have to find an area where there are many hotels and inspect them. It is quite acceptable to ask for the key to a room so that you can inspect it and determine if you want to rent it.

One area where I lived for some time in London is near Victoria Station. Victoria is one of the largest stations in London, it has both a Tube (underground/metro for trains within the city) and a British Rail (for travel to other parts of the country) station. Victoria Station also had facilities for checking in to a flight and having your checked luggage delivered to Gatwick airport via the Gatwick Express. This was really convenient, you can check your luggage and then do some last minute shopping before going to the airport! I’m not sure if they still do this though (comments appreciated). Another good thing about Victoria Station is the large shopping area which included a tourist information centre and a store that sold freshly baked bread. Often in the morning I would buy bread from the section that had the most steam coming from it (which was the most freshly baked) before catching a train.

Victoria Station is quite near many of the places you want to visit in London so I could walk to the British Museum and other places that are worth visiting (this depends on how fit you are). But the real reason for staying there is that the were many cheap hotels in the area. I could just walk down a street and know that I could find a room at one of the hotels.

One feature of UK hotels is that they almost always include free breakfast as part of the deal (with no option to exclude it). Of course this means that if you are capable of eating a significant breakfast and then skipping lunch then you can save some money.

A down-side to cheap hotels is that they almost never have a telephone in your room (just a pay phone in the hall), and if they do have a telephone then it will be wired in. Before wireless net access became common this was a problem as you couldn’t use a modem. More expensive hotels had an extra socket for a modem. In London there is a significant number of people who stay in hotels from Sunday night to Thursday night with their company paying (so they don’t stay in the cheap hotels). This means that most of the good hotels have cheap rooms on the weekend. So while living in London I would often stay at a good hotel on the weekend to get net access (and a few days in a luxury hotel at a cheap rate is a good change from a cheap hotel).

Nowadays wireless net access is common so it would be easy to find a free access point anywhere in London and there would be no need for this. But the possibility of getting cheap hotel rooms on the weekend is something to keep in mind. One benefit of this was when I had an employer paying for my hotel bills from Sunday night to Thursday night (as part of a deal to placate my colleagues who complained about working at the other side of London). I spoke to the hotel manager and suggested that having me check out every Friday and have the room empty on the weekend was not good for them and that they should offer me a significant discount to stay 7 days a week - they made me a good deal! At that time I had the lowest cost of living apart from when I lived with my parents while the hotel in which I stayed was quite comfortable (a large comfortable room with toilet and shower and a good hotel breakfast).

Moving to the Netherlands was quite easy for me as I was staying in hotels. All I had to do was to pack my suitcase, check out of the hotel, and catch the flight. One significant advantage of living in hotels is that you can easily move to another region or country. This gives the possibility of taking advantage of career opportunities that would not be possible if you owned a house and would be difficult if you rented an apartment.

When in the Netherlands I ended up staying in hotels of the Bastion chain (a chain or franchise of business hotels). I stayed in a couple of other hotels first and wasn’t particularly happy but with Bastion hotels I was always happy. I arranged a deal of a small discount in exchange for not getting the breakfast that was normally included (I like to sleep in and the Dutch breakfast didn’t appeal to me). One significant benefit of the Bastion hotels over London hotels was the size. The smallest room had two single beds, a large Dutch-style bathroom, two chairs at a desk that spanned about 3M of a wall (with multiple power sockets and a phone socket), and a good TV. At the time the hotel would play two movies over the TV system every night from video cassette. The videos played on the TV in the restaurant and in the rooms (if you selected the appropriate channel). Once I became known to the staff they would do nice things such as playing the movie I requested (instead of the scheduled one) and pausing the movie when I finished dinner so I didn’t miss anything while walking to my room. Also instead of giving me a free newspaper every day (in Dutch) they gave me some free drinks vouchers every week. Once you become a regular customer at a hotel the staff are always willing to change the deal to make you happy - even when it’s a chain.

One of the convenient factors of living in a business hotel is that they are located near business areas. I spent several months living in a Bastion hotel that was about 400M walk from the office where I worked. That was particularly convenient when the network broke at night - I could just walk back to the office to fix it!

The deal I had with the Bastion hotels made them about 50% more expensive than the (fairly luxurious) two bedroom apartment that I later moved to. So hotels are expensive and living in them is only an option if your employer pays for it or if you work in an industry where pay is reasonably good. Given that the vast majority of people who read my blog work in the computer industry (and I suspect that they are better paid than average) this should be a viable option.

Share This

Syndicated 2007-08-05 09:00:29 from etbe

Small PC for Creating Word Files

A friend recently asked for advice on a “REALLY small laptop/word processor thingy that would pretty much fit into a (big) pocket, and that only needs to write/word process“.

The first problem here is that most people associate “word processing” with desktop publishing and document management. Programs such as MS-Word are considered as having the features required of a word-processor (which includes spelling and grammer checking/correcting, annotations, colours, etc). Programs that have all those features take a lot of CPU power. A Pentium-4 system might be considered the minimum requirement for running a recent version of MS-Word. But a hand-held device can’t have such a powerful CPU (it’s too small to be able to dissipate the heat from such a CPU or contain batteries that can produce enough power to tun it).

The next problem is the issue of screen space. A VGA resolution screen (640×480) is regarded as high resolution in the PDA market. Such a resolution does not work with a word-processor that has three toolbars at the top of it’s screen and a paperclip taking up space at the bottom right! I’m sure that everyone who was using computers in the early 1990’s can recall the minimal word-processing programs. One thing to consider is that 640×480 in a 15 inch CRT screen is much more useful than 640×480 in a hand-held device as the larger screen can have fewer pixels per character and therefore display more text on the screen.

An added complication is that there are two methods of input for PDAs. One is to have a hardware keyboard (which may be a separate device or may be part of the PDA) and the other is to have a keyboard displayed on the screen. A hardware keyboard makes the device larger and a software keyboard takes up precious screen space (you just can’t win).

My PDA is an iPaQ model h3900. It has 64M of RAM, 32M of flash, no hardware keyboard, and a screen resolution of 320×240. I have done some serious writing on my iPaQ (including writing an entire article for Linux Journal) and it works reasonably well. For serious writing you can produce plain text on a PDA and then easily paste it into your program of choice on a PC later (PDAs generally support connection to a PC via serial port and/or USB).

The challenge is editing files that originate on a PC using a PDA. Generally I try and use HTML and TeX for my formatted documents so the text versions of those formats are easy to edit once you have learned them. Taking data from a MD-Word file, editing it on a PDA, and then taking it back to the PC would cause many problems and probably wouldn’t be worth attempting.

Recently I have been using my iPaQ for writing notes about email and blog posts that I will write. If I get an idea then I immediately write some notes about it on my iPaQ and then usually type it again instead of downloading it. For example the notes for this post were “write about RAM, storage, and screen resolution”. Often getting the initial ideas to start writing is the hard part. Writing a 500 to 1000 word blog post or message is easy once I have the ideas.

If I was going to buy a new PDA now I would prefer one with a hardware keyboard, the loss of screen space for a keyboard on the touch-screen is a serious impediment to writing. The maximum amount of text that can be displayed on the screen at any one time limits the complexity of what I work on (see my post about monitors for developers). Another factor is the fact that for small notes the amount of time taken to remove the stylus from it’s bay is greater than the amount of time saved by using it. So I end up writing small notes using my finger-nail on the touch-screen which is significantly slower than using a keyboard (even the crummy ones that PDAs have). Of course the keyboard would still have to be QWERTY and have raised keys so that I can touch-type.

I haven’t investigated this seriously as my iPaQ is good enough to last me for another year or two at least and I’ve got an unused spare iPaQ to replace it when it fails. But if anyone has any recommendations of Linux based PDAs with keyboards then I would appreciate some comments.

Share This

Syndicated 2007-08-04 21:00:18 from etbe

Debian Lunch Meeting in Melbourne and BSP

This afternoon we had a Debian meeting in Melbourne (Australia) arranged through the Debian-Melb mailing list.

We met under the clocks at Flinders St station, had lunch at a good Japanese restaurant, decided not to play LASER games (like paintball but with LASER guns instead of paint guns) due to the queue. The LASER games are at the Crown Casino, some people object to it on principle, but when you only use free tickets… One noteworthy thing about the casino is that they have a free cloak-room that stores bags (back-packs etc are not allowed on the gaming floor). I expect their cloak-room to be a little more secure than most places that you might stash your stuff (they have a reputation for security to uphold) so I felt safe leaving a back-pack containing a laptop in their care (it didn’t have any secret data and was a really old one).

After leaving the casino we had Gelati/Gelato ice-cream (Gelati is the plural of Gelato and either word may be used to describe Italian style ice-cream).

The general plan for the next meeting is to meet in the city at about 10AM on a weekend, play the LASER games, and then have lunch. Of course that would make it a greater requirement for people to arrive on time. ;)

While at the meeting we discussed in concept the idea of a Bug Squashing Party (BSP). I can get a free venue for up to 12 people outside business hours which is not far from the center of Melbourne and which has good net access and a good supply of keyboards, monitors, and other misc computer bits (even possibly some PCs that can have their hard drives temporarily replaced to test Debian stuff). One guy who is rather keen on this idea asked if it would be possible to bring sleeping-bags and sleep on the floor. I hesitate to ask the guy who owns the office about that, it might make him reject the idea entirely. So probably starting at about 10AM and going to 10PM would be enough. We could do that both Saturday and Sunday on some weekend or maybe even start on Friday night.

I’ve been planning to run a similar meeting to play Linux games which may end up as a games hacking party. I might get around to running that soon.

Share This

Syndicated 2007-08-04 09:00:49 from etbe

Getting Work in Another Country

Often there are possibilities to earn more money or gain valuable experience by working in another country. I learned (and earned) a lot while working in London and Amsterdam and recommend travelling if you get the opportunity.

There are two ways of getting work in another country. One way is to work for a multi-national company and get transferred, this gives benefits of having the company sort everything out for you (creating a bank account etc). But it isn’t an option that is open to many people.

Getting a job directly in another country is in some ways more difficult than expected and in some ways easier.

Here are some of the factors that make it easier:

  • Once you arrive in your destination country it’s usually easy to get work if the economic conditions are good. When choosing a country to migrate to and a time to migrate you will generally make sure that the economic conditions are reasonably good (or at least demand is greater than supply for your industry sector).

  • It’s widely believed by employers that employees from other countries have valuable experience to bring, due to working conditions being different in other countries. I am doubtful of this (but I don’t complain when it helps me get a job).

  • Employers often believe that employees from a long way away are very highly motivated and work really hard. I believe that this is correct as it applies to the employees that they get (EG Australians in the EU work really hard). Not that Australians in general would work harder than Europeans, but people who are willing to travel so far for their career will be motivated and people who have recently arrived in a country where they have few friends and no relatives have less things to distract them from work.

Here are some of the problems that you will face:

  • Different expectations of employers. For example in Australia a university degree is not really required while European employers demand it.

  • Getting a bank account. When I arrived in the UK I had trouble getting a bank account due to money-laundering laws. A passport was not sufficient and I needed proof of address, but renting an apartment without having a bank account was difficult too… I ended up getting an accountant to recommend me to a bank. Apparently the easiest way of doing this is to get an Australian bank that is part of a multi-national banking group to get their UK equivalent to set up an account before you leave Australia. Also I know people who had problems getting a Dutch bank account (fortunately there is the PostBank which deals with everyone). The UK laws may have changed in the last 8 years, but it’s the sort of problem that can get you in any country - as you can’t get paid without a bank account it’s serious!

  • Renting an apartment. I think it’s best to plan to live in hotels until you get a job that will last a while, then you can live reasonably close to your work. Also landlords will often want to know where you work before deciding whether to accept you as a tenant. I lived in hotels in the UK for almost a year and never rented an apartment because of this. It’s not a problem if the stuff you need can fit into a couple of suitcases.

  • Learning how to save money. Little things like bulk purchases of train tickets can save significant amounts of money. It’s the sort of thing that locals learn by osmosis but foreigners can take months or years to learn them. This is especially a problem when you don’t speak the local language and discount vouchers have fine print.

  • Catching a taxi. Taxi drivers generally only speak the local language and if you don’t speak it then you will have problems. Showing a taxi driver a laptop screen with printed directions and a map helps.

Share This

Syndicated 2007-08-03 21:00:30 from etbe

Popular Posts

I’ve just reviewed my web stats from last month. Here are what appear to be the most popular posts:

  1. Committing Data to Disk - about how RPM and DPKG don’t use fsync() the way I believe that they should. Surprisingly popular (more than twice as popular as #2), maybe the developers of both RPM forks and dpkg were repeatedly checking for comments.

  2. Terrorism Foolishness - found by StumbleUpon.com and got lots of traffic from there. More than twice as popular as #3.

  3. Prius vs Small Non-Hybrid Car - a little contentious as some Prius owners think I should compare the Prius to a Camry. I will visit a Toyota dealer soon to investigate this matter in more depth. Note that this is a post from June that was one of the most popular reads for July!

  4. Tevion MP4 Player Model M6 - a Review - review of an MP4 player that didn’t satisfy me.

  5. Installing Xen DomU on Debian Etch - from January but still getting read!

  6. A Support Guide to Xen

  7. Buying a Laptop From Another Country

  8. Xen and Heartbeat - another from June.

It seems that most readers of my blog come from Planet Debian. So the above seems like an indication of what people on that planet want to read.

Share This

Syndicated 2007-08-03 09:00:52 from etbe

Starting a Heartbeat Resource Without Heartbeat

The command crm_resource allows you to do basic editing of resources in the Heartbeat configuration database. But sometimes you need to do different things and the tool xmlstarlet is a good option.

The below script can be used for testing Heartbeat OCF resource scripts. It uses the Heartbeat management program cibadmin to get the XML configuration data and then uses xmlstarlet to process it. The sel option for xmlstarlet selects some data from an XML file, the -t -m options instruct it to match data from a template. The template is the /resources/primitive part. The --value-of expression will print the values of some labels from the XML. The script will concatenate the name and value tags and export them as environment variables (see my post about Configuring a Heartbeat Service for an explanation of the use of the variables). The TYPE variable is the name of the script under the /usr/lib/ocf/resource.d/heartbeat directory.

In recent versions of Heartbeat (2.1.x) the OCF_ROOT environment variable must be set before an OCF script is called. Setting it on older versions of Heartbeat doesn’t do any harm so I unconditionally set it in this script (which should work for all 2.x.x versions of Heartbeat).

The first parameter for the script is the id of the service to be operated on and the second parameter is the operation to perform (start, stop, and status are the only interesting values). The script will echo the exit code to the screen (0 means success, 7 means that the service is not running or the operation failed, and any other number means a serious error that will trigger a STONITH if Heartbeat gets it).

#!/bin/sh
$(cibadmin -Q -o resources| xmlstarlet sel -t -m \
"/resources/primitive [@id='$1']/instance_attributes/attributes/nvpair" \
--value-of "concat('export OCF_RESKEY_',@name,'=',@value,'
','TYPE=',../../../@type,'
')")
OCF_ROOT=/usr/lib/ocf /usr/lib/ocf/resource.d/heartbeat/$TYPE $2
echo $?

Below is another version of the same script that instead uses crm_resource to get the XML data. The output of crm_resource has a couple of lines of non-XML data at the start (removed by the grep) and also only gives the XML tree related to the primitive in question (so the /resources part is removed from the xmlstarlet command-line).

#!/bin/sh
$(crm_resource -r $1 -x | grep -v ^[a-z] | xmlstarlet sel -t -m \
  "/primitive/instance_attributes/attributes/nvpair" --value-of \
  "concat('export OCF_RESKEY_',@name,'=',@value,'
','TYPE=',../../../@type,'
')")
OCF_ROOT=/usr/lib/ocf /usr/lib/ocf/resource.d/heartbeat/$TYPE $2
echo $?

The problem with both of those scripts is that they rely on Heartbeat being operational. Performing any operations other than a status check while Heartbeat is running is a risky thing to do. If Heartbeat starts a service at the same time as you start it via such a script then the results will probably be undesired. One situation where it is safe to run this is when a service fails to start. After it has failed repeatedly Heartbeat may stop trying to restart it (depending on the configuration) in which case it will be safe to try and start it. Also you can put in temporary constraints to stop the resource from running by repeatedly running crm_resource -M -r ID until all nodes have been prohibited from running it (make sure you run crm_resource -U -r ID afterwards to remove the temporary constraints).

The following script does the same thing but directly reads the XML file for the Heartbeat configuration. This is designed to be used when Heartbeat is not running. For example you could copy the XML file from a running cluster to a test machine and then test your OCF resource scripts.

#!/bin/sh
$(cat /var/lib/heartbeat/crm/cib.xml| xmlstarlet sel -t -m \
  "/cib/configuration/resources/primitive [@id='$1']/instance_attributes/attributes/nvpair" \
  --value-of \
  "concat('export OCF_RESKEY_',@name,'=',@value,'
','TYPE=',../../../@type,'
')")
OCF_ROOT=/usr/lib/ocf /usr/lib/ocf/resource.d/heartbeat/$TYPE $2
echo $?

Share This

Syndicated 2007-08-02 21:00:40 from etbe

Xen Saves

A couple of days ago the hardware that is used to host this blog was upgraded - doubling the amount of RAM in the machine. To do this the machine was halted, memtest86+ was run to ensure that the new RAM worked correctly, and then it was booted up again. During that process my ssh session was not stopped! I merely refrained from typing anything until the upgrade was complete.

This is one feature I really like about Xen. It can save the memory image of a running domain to a file and then restart it later. TCP sessions remain open if timeouts have not elapsed. The command xm save can be used to save the state to a file and the command xm restore will restore it.

In Debian the location of the save files is stored in the file /etc/default/xendomains with the variable name XENDOMAINS_SAVE and defaults to /var/lib/xen/save.

A quick experiment with one test domain (running Debian/unstable in 128M of RAM and had just run apt-get dist-upgrade so the memory contents would not be all zeros) showed that gzip -9 would decrease the file to 35% of it’s size at a cost of just over 1 minute of CPU time on a Pentium-M 1.7GHz. But gzip -3 compresses it to 37% and only takes 9 seconds. 9 seconds of CPU time to save 80M of disk space seems a reasonable trade-off.

In my particular case it saves CPU time as the encryption I use for my root filesystem takes more CPU time than gzip -3 so compressing the data saves time. But I don’t expect my case to be common.

Now when Xen is used on a more modern machine with a faster CPU gzip -3 has the potential to save time as well as disk space. A machine with a CPU that is in aggregate 10x faster than my laptop (I think that means most 64bit multi-core CPUs) running with a single S-ATA disk (that will have a sustained contiguous read speed of 80MB/s and write speed that is less) will save time when saving multiple Xen DomU’s if it runs them in parallel and compresses them.

Also gzip is not the fastest compression program. There may be other options that are better suited to the needs of Xen.

I have filed a Debian bug 435406 requesting that compression be supported.

Share This

Syndicated 2007-08-02 09:00:52 from etbe

83 older entries...

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!