Now it’s RoR time

Having scratched the surface of python, I am now starting to look at Ruby on Rails as part of some RedPixie generated work. First impressions: it’s complex! It’s a bit apples and oranges to compare python (or any other scripting language) with Ruby on Rails as the latter is a web application framework and the former is a scripting language. Comparing Ruby itself though is fair and my first impression is that it looks rather “messy” compared to python. I just mean syntactically, and that is based on just a few hours of tutorials. That’s not saying much at all so I will have to comment more when I have learned more.

For rails, I started looking at

railsforzombies.org.

It’s good, but personally I can’t see the wood for the trees. While RoR is in itself large and complex, it is only a fraction of the “web experience” and is built on all (practically relies on) existing web technologies: web servers, page design and layout, MVC architectures, restful design style etc. Understanding all of that is a pre-requisite to starting with RoR.

With that in mind, I found the following links useful:

http://www.xfront.com/REST-Web-Services.html

and various pages under

http://guides.rubyonrails.org/.

Part of me thinks all this technology is piling up like a stack of dirty washing up dishes and if it gets and higher, the whole lot will come crashing down. Functionally it’s all fantastic stuff but increasingly, there’s got to be a consolidation of all these pieces into a technology that doesn’t require you to learn how every plate works from html at the bottom of the pile to ruby-on-rails at the top.

Remote Access

There are two extremes when using a computer these days: in the blue corner we have access everything remotely and in the red corner we have take everything with you. Most solutions appear at various levels of compromise between the two.

My recent attempts at “taking everything with you” are proving quite successful, albeit with one caveat. My 1TB hard drive may be suffering from hardware issues and require a re-format. It has led to several nasty messages from VMware workstation about not being able to write memory. This drive is the one that contains all my VMs. A means to back up the hard-drive is certainly required! Luckily it seems like a straightforward copy of the files works, but I have not tried to “restore” them yet.

After running chkdsk on the hard drive connected to the host, booting the VM caused Windows to run it’s own chkdsk on the C: drive. So far everything seems to be ok but regular backups will be continued!

Meanwhile, at the other end of the spectrum I finished a remote access trial of  “gotomypc” http://www.gotomypc.co.uk/remote_access/remote_access. Very stable, performant and easy. The one drawback being cost. So I am about to try some other solutions. “logmein” is next on the list https://secure.logmein.com/. It’s free.

Coding club

I have dropped off my daughter at “Coding Club” which sounds like an excellent idea! Looking forward to finding out what they did. That reminded me to post a couple more Euler solutions. Not pretty, but they worked.

Euler8 Part 1

Euler 8 initialisation code

 

 

 

 

 

 

 

 

 

 

 

Euler 8 Part 2

Euler 8 Main Program

 

 

 

 

 

 

 

 

 

 

 

 

Euler 9 only took about 5 minutes to do, there are lots of possible optimisations!

 

Euler 9

Euler 9

 

 

 

 

 

 

 

 

Incidentally, the coding club started with html and the pupils made a web page (manually).

Also, further to my post below, the easiest way to move a VM from vSphere to VMware Workstation, is of course, copy the files. It is running very well.

Taking it all with you

I am impressed with the 1TB Freecom XXS drive I bought. I have used it to backup my QNAP prior to a firmware upgrade and I am now using it for a bunch of VMware workstation virtual machines.

Format of XXS

Maximum write speed of XXS

I am not impressed with the interoperability of VMware products. I exported a guest from vsphere into an ovf package but you can’t import this into VMware workstation! I’ve had this problem before and there are plenty fixes on the web. Still very annoying though.

OVF Error

Workstation import error

As it happens, I realise that I created this ovf by exporting a hardware version 8 machine which I strongly suspect will not load into VMware workstation 7. Have to wait for an upgrade.

 

 

 

 

Success! Intuition.

My P2V finally ran to completion in some small hour of the morning. I haven’t had time to boot it up yet but that is certainly good progress.

I don’t have any detailed technical explanation of why it finally worked but following my intuition, call it guesswork, got me through. Not ideal but there’s plenty of room for creativity in IT.

My initial attempt, after chopping out the NAS datastore (QNAP), VC Appliance and a bunch of services from my source machine, failed at 31% with a blue screen. The only change I made was to unplug a USB DVD writer and try again, at which point it ran to completion.

I will include a screenshot later.

My next steps will be to storage vmotion the target to the NAS, grow the disk (which was thin an minimal spec.) and see how it performs, assuming it works at all.

Actually doing a P2V conversion!

P2V-ing old laptops is something I have mentioned in the past and had some success with. I’m a fan.

At the moment I am trying to P2V a four year old HP mini-notebook running XP onto my ESXi 1.5 lab environment using VMware converter. I’m not having much success. VMware Converter fails at different points, mostly around 2% but in one case it got to 24% before blue-screening.

I started by using my QNAP as a datastore but have given up on that as I don’t think it, or maybe my network, can cope. I could have experimented with throttling the bandwidth but its time, time, time. I’ve made some space on the locally attached storage of my ESXi host but without any immediate improvement.

I am running the converter locally and connecting to the new VC appliance. That itself is pretty fat and may be using too much resource itself so I may cut that out too.

Other things I need to try are slimming down the services running on the old machine. You know how stuff tends to build up like limescale on top of your OS.

Will keep posting my progress.

How about that, an actual post about P2V!

The vSphere limit effect

VMware Limit Effect on Linux top

VMware Limit Effect on Linux top

I believe the effects of limiting a guests CPU in vsphere are well understood but I for one don’t like the way VMware implement this. I have just verified the behaviour on ESXi 5.0.0 is the same as 4.1 (which is only to be expected).

Guests get confused, is the bottom line. At least Linux does, which is particularly noticable with “top”. In the screenshot above of a Centos guest, I have limited the CPU to 1000Mhz using virtualcenter. To me, it would be logical that the guest O/S would be presented with a 1000Mhz CPU but this is not the case. The output of /proc/cpuinfo means that Linux thinks it is running on a 3.47Ghz i5. Is it really hard to do, or something?

The upshot is that when the guest is maxed out, as in the screenshot, top shows 100% us time (correct) but only 29% of the CPU. Which is correct if you consider the pCPU but not, if like me you don’t think a guest should have any knowledge of the real hardware. I think Centos should see a 1000Mhz vCPU and top will correctly display 100% CPU Time.

Must check this on other hypervisors (Xen and KVM) sometime.

P.S.
Saddened to hear of the death of Dennis Ritchie today. Someone who I can identify as having a large impact on my life, though I never knew or met him. Such is the world we live in. Eventually we will all exit(0).

Episode IV – A New Hope

Off topic (again) but hey, better than no topic at all.

With my own two children (now 7 and 11) growing up fast, I am increasingly interested in what they learn under the heading of ICT at school. As far as I can tell from my eldest, this involves learning Word, Excel and Powerpoint. All well and good as these are useful skills but it’s not the kinds of IT I learnt. Not “was taught” because we were riding the wave of ZX spectrums and BBC micros so taught ourselves and made it up as we went along.

What I learnt was basic programming. Basic by name and basic by nature. And via peek and poke into the world of machine code programming.

I think these programming skills are fundamental to an understanding of IT and I would like my two to learn them. I don’t hold out much hope of them learning this at school (maybe I will be proved wrong, which would be great). I’m not going to force them to read Knuth’s “Fundamental Algorithms” and they’re not going to pick it up themselves from their laptop which is good for word processing and Facebook.

So I have started teaching my daughter the basic concepts of programming using python. She gets plenty of maths homework which is at the stage that is perfectly suited to writing small programs to e.g. find out all the factors of a given number. Python is clean, simple and has a maths bias so it is perfect as a starter language. As the maths homework gets harder I hope the programming challenges will too. An internal project “Euler” no less.

So far my eldest seems very keen.