Technology Through a Technocrats Eyes

Adventures in Tech

Next Page

Resizing the disks of a linux virtual machine
Posted at: 2011-02-27 @ 17:11:36
So recently I had the situation where I needed to resize (or grow a linux partition)

If your using an EXT2 EXT3 or EXT4 partition in native mode without LVM.

1. Allocate the additional space (normally done in a virtual server)

2. Work out which partition needs to be grown. This can be done with fdisk –l, although you MAY need to rescan the scsi disks prior to seeing the full space (see http://commscentral.net/tech/?post=44)


3. One you know the volume, run resize2fs -p /dev/sda2

4. Run df –h to confirm the disks have resized

This can all be done without a reboot of the VM.

Caveman



Rescanning disks in linux
Posted at: 2011-02-27 @ 16:57:13
So in windows disk, rescanning disks is as simple as going to disk management, right clicking and hitting rescan.
Linux its not so simple.

How to rescan disks in linux

first you have to find the scsi folders, for that search
find /sys -name scan

In my case this gave me the following results

root@xxxx:/# find /sys -name scan
/sys/devices/pci0000:00/0000:00:07.1/host0/scsi_host/host0/scan
/sys/devices/pci0000:00/0000:00:07.1/host1/scsi_host/host1/scan
/sys/devices/pci0000:00/0000:00:10.0/host2/scsi_host/host2/scan
/sys/module/scsi_mod/parameters/scan


The first 3 look like devices, the last one looks like a module so we'll ignore that.

Now run the following three lines, this forces each scsi device to rescan

echo - - ->/sys/devices/pci0000:00/0000:00:07.1/host0/scsi_host/host0/scan

echo - - ->/sys/devices/pci0000:00/0000:00:07.1/host1/scsi_host/host1/scan

echo - - ->/sys/devices/pci0000:00/0000:00:10.0/host2/scsi_host/host2/scan

with the echo - - -> note the spaces. so its echoSPACE-SPACE-SPACE->/sys.....

fdisk -l will now show the additional device!

Phew, really should be easier than that


Direct Access using UAG - ipv6 to ipv4 and dns routing notes
Posted at: 2010-05-17 @ 17:25:22
A good article came on on technet the other day.
It explains clearly the ins and outs of Direct Access and how the NAT64 works when doing the NAT of a 64bit packet.

There is also a good tip about fixing a DNS issue for users on wireless cards.


http://blogs.technet.com/edgeaccessblog/archive/2010/04/30/directaccess-mobile-connections-dns-records-and-more.aspx

Cheers

Caveman



Advanced setting preference pane add-in for OS X
Posted at: 2009-12-17 @ 21:48:09
Hi All,

So a few weeks back I found a really useful application for mac OS X that allows setting of some advanced settings in OS X.
Now I can already hear the hardcore command line guys, saying, but you can do this at a command line level. yes I know! However this makes it easy, knows what the default was (incase you want to go back) but also tells you what advanced settings there are!

The program is called Secrets and its a preferences plugin. The site is http://secrets.blacktree.com/ and they also have a really handly list of all the secrets, plus the command line commands to set them! Which is almost as handy as the program!

I've certainly found it useful for a few bits and pieces!

Enjoy!

Caveman


Changing ESX virtual centre server when original virtual host no longer available
Posted at: 2009-07-14 @ 16:53:04
Just a quick post today but I wanted to share something useful I discovered.

I've got a vmware esx server that is setup and is managed using virtual centre. Due to hardware limitations we have virtual centre running inside a vmware on the esx server.

I know this isn't best practice, however it is a supported configuration by vmware.
Recently we had a power outage that rebooted the server and the vm running virtual centre wasn't setup to start automatically so the virtual centre server didn't come back up.
This virtual centre server also handles the licensing for the esx host. Due to there being no licensing server available, after the 14 day grace period, esx wouldn't allow any new vm's to be started as it didn't have a license.
This presented me with a problem, I needed to start up the virtual centre server to fix the licensing issue, however esx didn't have any licenses to start the vm up........ URHHHHHHHHHHHHH!!!!!!!!!!!

I figured the only solution would be to bring up another server with virtual centre installed and point the esx server at that so it would have a license and then allow me to boot up the vm before repointing the esx host back to its vm virtual centre.

However there is a problem a I quickly discovered, ESX won't let you remove a virtual centre from managing it, unless it can contact that virtual centre server to say "goodbye".
You can add the ESX host into the other virtual centre however it quickly disconnects and you can't manage it at all.

After a bit of head scratching I found a solution.
1. ssh to your esx host.

2. Edit your license.cfg file in /etc/vmware/license.cfg (vi /etc/vmware/license.cfg as root will do it)

3. Here we have 2 possible solutions. 1, empty the file or 2, modify the line that reads like SERVER=27000@192.168.1.10 to something else.
I've found that solution 2 doesn't seem to work, I found solution 1 worked for me, but from the vmware docs option 2 should work.

4. Then run /sbin/service mgmt-vmware restart

Your ESX host will now reboot and if you went option 1 at step three you will be able to add the ESX host back into another virtual centre server.

Problem solved!


Redirecting Documents and Settings and Local Settings on a Citrix / terminal server environment
Posted at: 2009-03-02 @ 22:53:30
Hi All,

As most of my readers probably have gathered I work in IT for a company who supports environments for small to medium business.
Recently I've been working in a team to build a citrix server farm for around 300 users.

In this project we had a particular application that does a local install into Local Settings in the users profile and these local settings needed to be saved and roamed from one server to another.
We were using windows roaming profiles due to their ease of support and deployment into an exiting environment. How this posed a specific problem, by default windows roaming profiles doesn't roam local settings or any of the folders contained within it.

I discovered two possible solutions to this problem.

Solution 1:
Was to redirect the whole Documents and Settings folder to another location such as on a file server or a mapped network drive (if UNC paths weren't supported).
This can be done with the following registry key: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\ProfileList\ProfilesDirectory
The default value of this key is %SYSTEMDRIVE%\Documents and Settings however this can be change to anything. Like D:\Documents and Settings or changed to a network UNC path such as \\mainFileServer\tsprofiles which is what I would have done for our citrix farm.

This will cause windows to use that path for its documents and settings folder. This would also remove the need to setup windows roaming profiles for the terminal server farm, as each server would have its documents and settings pointed to the same file server share.
It should also be noted that using this doesn't increase logon times, infact it will reduce them as it prevents the users profile from having to be downloaded from the profile server and cached locally on the terminal server itself until logoff, at which point it gets packed up and set back to the profile server.
However any file that is saved to the users profile will take longer, as instead of writing to a local disk, we'd be writing to a network share and we'd have all the network overhead to deal with.
It would also result in a lot of open files on the profile server, for example if word, and outlook where open, you'd have any outlook pst files open and words normal.dot amount other files. It becomes apparent that this number could quickly rack up.

So why is this a worry? When I file is opened via a remote share, this whole file has be able to be loaded into something called kernel memory by the kernel so the data can be fed off to the network stack. On a 32bit system the maximum amount of kernel memory possible is 2GB (yes I know 32bit OS's support 4GB of memory, however that's not native support and splits user land and kernel land apart, but this is outside the scope of this article).
If you happen to run out of kernel memory you will start getting unable to open file errors when trying to open a file over a network share or on the system itself, if the situation becomes bad enough you will find that core services like group policy processing won't be able to run and the server will lock up and have to be rebooted or have the open files closed (if that's possible).

If the 2GB max is not enough kernel memory the only option will be to go for a 64bit operating system. Current Microsoft 64bit operating systems can support up to 8 terabytes kernel memory, although in theory 64bit can address up to 16 exabytes.
See http://support.microsoft.com/kb/294418 and the table under the heading System PTEs for more information.



Solution 2:
Solution 2 certainly wins under the simple heading!
Clearing the value of the key HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\ExcludeProfileDirs causes windows roaming profiles to copy the local settings folder and the folders under them, just like any other folder in the users profile!
The default value of this key is: Local Settings; Temporary Internet Files;History;Temp

In my case I just cleared this whole key, as I wanted all the settings to copy over, however some folders could still be left in here.
I also believe it would be possible to use this key to exclude certain folders inside the profile itself from being roamed and saved back to the profile server. Which would be handy if you were dealing with an application that had a really large and unneeded amount of data in a folder, which didn't need to be saved.

This solution has a disadvantage in the fact that if the local settings folder is large it will increase logon and logoff times just because of the amount of data that has to be downloaded and upload. However in my case the profile server didn't have the resources to support all the open files from solution 1, so this was the only decent option left.


I have included a paste and a link to an group policy template I made that will clear this key for any user who has the policy applied and make local settings roam at the end of this post.


Have fun!

Caveman


---------START RoamingLocalSettings.ADM-------------
CLASS USER

CATEGORY !!RoamingProfiles
POLICY "Enable local settings in roaming profiles"
KEYNAME "Software\Microsoft\Windows NT\CurrentVersion\Winlogon"
VALUENAME ExcludeProfileDirs
VALUEON ""
VALUEOFF "Local Settings;Temporary Internet Files;History;Temp"
END POLICY

END CATEGORY

[strings]
RoamingProfiles="Enable local settings in roaming profiles"
---------END RoamingLocalSettings.ADM-------------

Download ADM file HERE



Next Page