Monday, November 15, 2010

tar into a pipe and then out of the pipe for copying files

Sometimes you want to copy a directory from one location to another and in order to preserve all permissions, etc, you can easily tar the files into a pipe and then out of the pipe:

cd fromdir; tar cf - .| (cd todir; tar xfBp -)

Drop a 'v' (without the quote marks) into the second tar command and you will get a file listing of all the files it extracts from the pipe.

Thursday, September 2, 2010

VMWare Snapshot Troubleshooting

If you try and delete a snapshot from the GUI, but it times out, you can use these commands to see what's going on. First login to your vmware server as root:

# vmware-vim-cmd vmsvc/getallvms
Vmid Name File Guest OS Version Annotation
80 host1 [vm-host1] host1/host1.vmx winLonghornGuest vmx-07

96 host2 [vm-host2] host2/host2.vmx winLonghornGuest vmx-07


That will give you the VMID for the system you want to check. Feed that into the next command:

# vmware-vim-cmd vmsvc/get.tasklist 80

(ManagedObjectReference) [
'vim.Task:haTask-80-vim.vm.Snapshot.remove-1460141'
]

To monitor the snapshot deletion process itself, issue the following command:

# watch -d "ls -touh --full-time *.vmdk"

where:

-d highlights the differences between successive updates

t sorts by modification time
o inhibits display of group information to shorten the output display
u sorts by and shows access time
h prints sizes in a readable format like 1K 234M 2G
full-time displays the time in full format

This command monitors the contents of a directory and displays files by their modification date. You can observe that snapshots first commit their data to the parent file recursively and finally to the base disk.


The output looks like:

Every 2.0s: ls -touh --full-time *.vmdk Thu Sep 2 09:10:00 2010


-rw------- 1 root 56G 2010-09-02 09:10:00.000000000 -0400 host1-000002-delta.vm
dk

-rw------- 1 root 113M 2010-09-02 08:26:47.000000000 -0400 host1_1-000001-delta.
vmdk

-rw------- 1 root 1.6G 2010-09-02 08:26:46.000000000 -0400 host1-000001-delta.vm
dk

-rw------- 1 root 500G 2010-09-02 08:26:44.000000000 -0400 host1-flat.vmdk

-rw------- 1 root 370 2010-09-02 07:16:31.000000000 -0400 host1_1-000001.vmdk

-rw------- 1 root 364 2010-09-02 07:10:16.000000000 -0400 host1-000001.vmdk

-rw------- 1 root 7.9M 2010-09-02 07:10:16.000000000 -0400 host1_1-000001-ctk.vm
dk

-rw------- 1 root 7.9M 2010-09-02 07:10:16.000000000 -0400 host1-ctk.vmdk

-rw------- 1 root 579 2010-09-02 07:10:16.000000000 -0400 host1.vmdk

-rw------- 1 root 7.9M 2010-09-02 07:10:15.000000000 -0400 host1-000001-ctk.vmdk

-rw------- 1 root 7.9M 2010-09-02 07:10:15.000000000 -0400 host1-000002-ctk.vmdk

-rw------- 1 root 7.9M 2010-09-02 07:10:14.000000000 -0400 host1_1-000002-ctk.vm
dk

-rw------- 1 root 14G 2010-09-02 07:10:10.000000000 -0400 host1_1-000002-delta.
vmdk

-rw------- 1 root 442 2010-09-02 01:15:08.000000000 -0400 host1_1-000002.vmdk

-rw------- 1 root 380 2010-09-02 01:11:03.000000000 -0400 host1-000002.vmdk



Also reference VMWare
KB Article: 1007566

Thursday, January 21, 2010

last history on Solaris resets itself nightly

The fix to this problem is found in this SunSolve document:


http://sunsolve.sun.com/search/document.do?assetkey=1-61-205225-1

Solaris 8 and above:

Edit the /usr/lib/acct/runacct script.

Find the "nulladm ${_wtmpx}" line and comment it out.

Wednesday, December 16, 2009

Solaris 10 and VMWare vmxnet ethernet driver

The problem that I had been experiencing was that I was unable to install the VMWare vxmnet ethernet driver onto a Solaris 10 x86 server running on a VMWare vSphere 4.0 server.

The solution to getting the vmxnet interface to work is as follows:

1) install stock e1000 ethernet interface on a Solaris VM
2) install the VMWare 4.0 tools on a Solaris VM
3) halt and power off VM
4) install a second ethernet interface onto a Solaris VM, using the vmxnet3 driver
5) ifconfig vmxnet3s0 plumb
6) ifconfig e1000g0 unplumb
7) mv /etc/hostname.e1000g0 /etc/hostname.vmxnet3s0
8) reboot

The trick is to have two ethernet interfaces (e1000 and vmxnet3) and just unplumb from Solaris the e1000 interface. Don't remove the e1000 interface from the VMWare host configuration.

Monday, December 14, 2009

Solaris syslog-ng error

If you get an error like:

# svcs syslog-ng
STATE STIME FMRI
maintenance 8:50:44 svc:/system/syslog-ng:default

# svcs -xv syslog-ng
svc:/system/syslog-ng:default (syslog-ng)
State: maintenance since Mon Dec 14 08:50:44 2009
Reason: Start method failed repeatedly, last exited with status 1.
See: http://sun.com/msg/SMF-8000-KS
See: man -M /usr/share/man -s 1M syslog-ng
See: /var/svc/log/system-syslog-ng:default.log
Impact: This service is not running.

# cat /var/svc/log/system-syslog-ng:default.log
[ Dec 14 08:50:42 Disabled. ]
[ Dec 14 08:50:42 Rereading configuration. ]
[ Dec 14 08:50:43 Enabled. ]
[ Dec 14 08:50:43 Executing start method ("/lib/svc/method/svc-syslog-ng") ]
Error parsing command line arguments: Conversion from character set '646' to 'UTF-8' is not supported[ Dec 14 08:50:44 Method "start" exited with status 1 ]
[ Dec 14 08:50:44 Executing start method ("/lib/svc/method/svc-syslog-ng") ]
Error parsing command line arguments: Conversion from character set '646' to 'UTF-8' is not supported[ Dec 14 08:50:44 Method "start" exited with status 1 ]
[ Dec 14 08:50:44 Executing start method ("/lib/svc/method/svc-syslog-ng") ]
Error parsing command line arguments: Conversion from character set '646' to 'UTF-8' is not supported[ Dec 14 08:50:44 Method "start" exited with status 1 ]
[ Dec 14 08:52:06 Rereading configuration. ]

This has nothing to do with the configuration, merely a missing charset.alias file.

To correct:

# ln -s /usr/lib/charset.alias /usr/local/lib/charset.alias

# svcadm clear syslog-ng

# svcs syslog-ng
STATE STIME FMRI
online 8:59:38 svc:/system/syslog-ng:default

Tuesday, December 8, 2009

Change WMware vSphere IP Address

To change the IP Address of a vSphere 4.0 server:

1) check the service console:

# esxcfg-vswif -l

[will return the current IP information and the name of the Service Console, in most cases: vswif0]


2) run the esxcfg-vswif command with the new information

# esxcfg-vswif -i newipaddress -n newsubnetmask vswif0

3) check the following files:

# cat /etc/sysconfig/network-scripts/ifcfg-vswif0

make sure the new information is in the file.

# cat /etc/sysconfig/network

4) restart the network -- this will disconnect you unless you are on a console:

# service network restart

You should be done at this point.

Monday, November 30, 2009

Citrix XenApp Server Application Installation Best Practice

Prior to installing an application on a Citrix XenApp server:

Start --> run --> change user/install

[install the applications and all updates]

Start --> run --> change user/execute

That will ensure that all of the registry settings will work under XenApp.