Keith Smith - My Blog

Keith Smith - My Blog

Our time in Seattle

Wednesday, August 26, 2015 - Posted by Keith A. Smith, in Journal of thoughts

This Post is private, you need to be a active susbcriber to vew this Post. Click here to Subscribe
View Comments 0 Comments
Share Post   

My Thoughts on Docker

Tuesday, June 30, 2015 - Posted by Keith A. Smith, in Journal of thoughts

Docker uses Linux LXC to encapsulate a fixed environment into which you have built some software that depends on a stable config and wants isolation from everything else. To the software it feels like it is alone on a machine, but actually it is alone in what Docker calls a container.

You can have 100s to 1000s of containers running on one machine. You can also group containers together to make larger projects. Obviously with the encapsulation, you can patch or upgrade the OS without any fear it will break something running in a container. Unlike VMware the encapsulation is not on the chip level with a hypervisor, but on the OS level. So those big servers you have, the ones that can easily run heaps of things, but you don't really want to have heaps of VMs? (which really just passes the update/patch/reboot buck, if you think about it), these can run heaps of Containers. In my opinion Docker reminds me of bsd 4.0 jails, developed in 2000 for a hosting company which predated Solaris zones.

Docker has many concerns, particularly around security, which in turn can be a gating or otherwise limiting factor in acceptance by several industries. This is the nature of open source - there are many options as every individual that disagrees with someone else spawns his own solution addressing what he views as the most important problems. In the end there are many container options, even just in the case of linux.

Companies that have embraced container-based virtualization more often have more than just one such technology in place. This year's openstack summit showed this strongly. I do see great potential with containers. One of the caveats i am facing right now when designing my potential future architecture, it is redundancy/availability. There is no live migration of containers. So you have to consider that. You would have redundant containers, but i can see where IP addressing can get a bit complicated when using keep-alive or ucarp. And this is because they wouldn't work at the container level, but at the docker host level. If you lose a container, the virtual IPs wouldn't be active on the other host. And docker uses its own network addressing for the containers. Therefore, essentially each docker host is a "router".
View Comments 0 Comments
Share Post   

xackup for xenserver

Saturday, June 20, 2015 - Posted by Keith A. Smith, in Xen

I recently was tasked with to rebuild an entire xenserver farm, i started to put together a plan of action on how I was going to accomplish this. I started thinking about the servers, I figured I could grab a USB sticks and create some bootable USB sticks from the xenserver iso. Next I made note of all the hypervisor network settings (screen shots are the best way to go) so that part was covered, lastly can the virtual guest and storage. A new NAS was going to be in play so i needed to find a way to backup the guest and export them, I found a software called xackup which was priced right but I wanted to vet it before making a purchase. I downloaded the trial (14 days for the elite version) installed on a test machine to put it through its paces, I backed up one guest while it was running to see how it would handle it. 

The backup ran smooth and didn't cause any errors or outages which was great, now I wanted to test the restore capabilities of xackup. Since the virtual guest I was working with wasn't important I powered it off and deleted it, yes you read that right. Since I haven't used this product before I did have an xenserver export (e.g. .xva) file just in case xackup failed me. I proceeded to restore the virtual guest with xackup, about 20mins later the restore was complete and the guest vm was in great shape which i define as (virtual disk restored & attached, network settings correct, OS start up clean, etc) once all I confirmed all that I knew this was going to be my tool of choice. I proceeded to backup all the virtual guest which took quite bit of time then i reviewed the log reports for each virtual guest backup, they all were successful with no errors.

I then shutdown all the guest, followed by the hypervisors and lastly the storage array. Next I swap out the hypervisors along with storage, with all the new gear in place I get the install for xenserver going on all the hypervisors. While the installs were running for xenserver, I setup the LUNs on the NAS so the I can point the hypervisors at the correct targets. Once the xenserver installs were completed, I setup the network addressing and make sure the NTP is working correctly (I have had issues with this in the past) then I launch xencenter so I can setup the networking on the hypervisors, create a pool,add the hypervisors to the pool then finally map the CIFS and iSCSI storage. 

Now here comes the fun part i need to restore all the virtual guest, I launched the xackup software so I can start restores but at that point in noticed that there is no way to restore all the guest at the same time nor anyway to schedule the restores. That was a big flaw to me since you can schedule multiple backups, so I was stuck having to restore each guest two at time (I had 2 laptops running with the xackup on it) and eventually everything was backup and running on new shinny gear. I have made a few suggestions to the developers of xackup but overall I think its a great tool for the price and its simple, effective and affordable.
View Comments 3 Comments
Share Post   

Automate everything!!! with less code

Wednesday, June 3, 2015 - Posted by Keith A. Smith, in Automation

I have been writing scripts (e.g. vbsscipt,BATCH,Powershell,BASH,etc) to automate various redundant tasks over the past decade. A  few years ago I discovered a software called winautomation, I never got a chance to put it through its paces....until recently. I needed to have some sql backups moved from one location to another, this had to take place on a daily basis. In the past I would have wrote a powershell script or BATCH file to handle this, then use the task scheduler to run the script at the needed time. Instead I decided to give winautomation a shot at this, I downloaded the trial version & installed it on the box I needed the tasks to run. After that I opened up the console and I noticed so many available actions sorted by category (e.g. system actions - run a application,etc conditional statements,loops) and the list goes on. I created a job then inserted a move files action, next I put in the source and destination for the transfer. In the winautomation world it looks like

I ran this job and it worked!!! which was great. Now I wanted to add a house cleaning task which was I wanted to only retain 30days of data in the destination, to this I wrote a powershell script to do this for now, {code}Get-ChildItem -Path "driveletter:\" -Recurse | Where-Object LastWriteTIme -LT (Get-Date).AddDays(-30) | Remove-Item {/code} and saved it. Now the really cool thing I saw is that it has the ability to record mouse & keystrokes via a macro recorder, I figured I would try the next phase of this with the macro recorder.  I started the macro recorder and proceeded to open powershell, then I did cd / cd folderlocation followed by .\remove30dayoldfile.ps1 finally ctrl+alt+s to stop the macro recording.  The job actions resulted in 2 line entries

With all of this in a single job now I save then run it. The result ends up being exactly what I wanted, to finish it off I added a schedule trigger so it can run at the time & date that I needed and lastly a send email notification
once the schedule trigger was complete. So far this has been working great, I will be purchasing this because it will be a huge time saver to automate certain task very easily instead of writing complex code.
View Comments 0 Comments
Share Post   

XenServer VM Backups

Tuesday, June 2, 2015 - Posted by Keith A. Smith, in Xen

I've been trying to conjure up some way to backup the guests that reside in a xenserver virtualized environment. I started off by looking at what i would call my usual suspects (e.g. unitrends, alike, etc.) unfortunately in this situation they all let me down for one reason or another, so i did what most creative minds do when they can't find a solution "Make my own". I figured i start by jumping on to the cli at the host, i know most hypervisors reference the guest by UUID's. I spent sometime looking through the variables and commands on the host, i eventually came up with

# xe vm-list
 which produces the following output for all guests

uuid ( RO)           : 15b96001-84c6-83d1-ef11-8gh6509i122j
     name-label ( RW): nameoftheguest
    power-state ( RO): running

Another command i saw that was available was #vm-snapshot, so i figured I'd try and string it together by doing a xe vm-snapshot uuid=15b96001-84c6-83d1-ef11-8gh6509i122j or tab which display all uuid's. And the tale of the command i place name-label=snapshot, so the whole thing would look like 

xe vm-snapshot uuid=15b96001-84c6-83d1-ef11-8gh6509i122j name-label=vmsnapshot

Now that i saw that worked i figured i would develop a crontab task using the #crontab -e command that would run a shell script (which i will post at another time) to handle this redundant task which was version1 of this solution. Once I uploaded the shell script i needed to make it executable, which i did by running the chmod +x command. I attempted to execute it and got a error bad interpreter - No such file or directory, some times when you move files from DOS/windows to linux or nix system you run into the ^M charater problem. The way i have solved this so many times is simply to open the file in the vim editor using the following command
vi -b once the file is open you will see ^M at the end of each line, the quickest way to remove this is to run :1,$s/^M//g the trick to this command that you don't really type a ^ character and then a M character 
to generate that command. You actually type a [Control][v] and then a [Control][m] to create the necessary character then do a :wq to write and quit the editor. I figure it must be punishment for not developing the script in the vim editor in the first place. 

So far this has been working for the xenserver environment, in version2 of this i included retention elements and frequency of backups for individual guests. In my last version3 i added more comments to the script because the code was pretty extensive at this point (over 100 lines of code). The next item i have on my dev to-do list would be to add some mail functionality, so i can be notified of the out come of the backup job.

Note: this files used to perform the backups should copied from the hypervisor prior to any upgrades.
View Comments 0 Comments
Share Post   

Page  <1...1314151617...18>