fbpx

APD VMware Storage Issues

So I had this issue with dead paths:

~ # esxcli storage vmfs extent list
Volume Name VMFS UUID Extent Number Device Name Partition
———– ———————————– ————- ———————————— ———
BackupSAN 50eb10a0-4f1a9256-5434-90e2ba22c340 0 naa.6842b2b000687ee500002a4850ea9934 1
Operations 5053a326-370b5095-739a-00137234e92a 0 naa.68b7b2acf4b8d12b3a051502000020ca 1
Templates 506204f5-fe667464-c1b1-90e2ba22c340 0 naa.68b7b2acf4b80148200615353227e7f3 1
CorpStor01 5053a1e4-e68f6227-0e8a-001ec9fd0643 0 naa.68b7b2acf4b8b1163a05e5010000c0a2 1
~ # esxcli storage core device detached list
Device UID State
———————————————————— —–
naa.6090a058e015725f990965020000a09e off
naa.68b7b2acf4b8f10e0d0585010000004c off
t10.FreeBSD_iSCSI_Disk______100000010_______________________ off
~ #
~ # esxcli storage core device detached remove -d naa.6090a058e015725f990965020000a09e
~ # esxcli storage core device detached remove -d naa.68b7b2acf4b8f10e0d0585010000004c
~ # esxcli storage core device detached remove -d t10.FreeBSD_iSCSI_Disk______100000010_______________________

How to SSH Between Two Linux Computers Without Needing a Password

1. ssh to server1

Connect to server1 and generate a public/private key pair.

1
2
3
ssh myusername@server1
password:
ssh-keygen -t rsa

When you run this command you will be prompted to answer several questions. Just hit enter each time until you are returned to a prompt.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Generating public/private rsa key pair.
Enter file in which to save the key (/home/local/myusername/.ssh/id_rsa):
Created directory '/home/local/myusername/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/local/myusername/.ssh/id_rsa.
Your public key has been saved in /home/local/myusername/.ssh/id_rsa.pub.
The key fingerprint is:
15:68:47:67:0d:40:e1:7c:9a:1c:25:18:be:ab:f1:3a myusername@server1
The key's randomart image is:
+--[ RSA 2048]----+
|        .*Bo=o   |
|       .+o.*  .  |
|       ...= .    |
|         + =     |
|        S +      |
|         .       |
|      . .        |
|      E+         |
|      oo.        |
+-----------------+

Now you will need to copy the public key you just generated and save it somewhere, you will need it later. Also ensure when you copy the key that the text is all on one line, if there are line breaks in the text, it will cause problems later when you try and use the key.

1
2
3
4
5
6
7
cd .ssh
cat id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAyFS7YkakcjdyCDOKpE4RrBecRUWShgmwWnxhbVNHmDtJtK
PqdiLcsVG5PO94hv3A0QqlB1MX33vnP6HzPPS7L4Bq+5plSTyNHiDBIqmZqVVxRbRUKbP44BaA9RsW2ROu
8qdzmXRPupkyFBBOLa23RJJojBieFGygR2OwjS8cq0kpZh1I3c1fbU9I5j38baUK0naTBe2v7s/C8allnJ
hwkfds+Q9/kjaV55pMZIh+9jhoA8acCA6B55DYrgPSycW6fEyV/1PIER+a5lOXp1QCn0U+XFTb85dp5fW0
/rUnu0F9nBJFlo7Rvc1cMuSUiul/wvJ8tzlOhU8FUlHvHqoUUw== myusername@server1

2. ssh to server2

Now we will copy the public key from server1 to server2.

1
2
3
4
5
6
7
ssh myusername@server2
password:
mkdir .ssh
cd .ssh
vi authorized_keys
# paste the public key
chmod 600 authorized_keys

3. Test that your setup is working

1
2
3
4
ssh myusername@server1
password:
ssh myusername@server2
# you should not be prompted for a password!

Autologin for Windows Server

(From the Microsoft Site) To use Registry Editor (Regedt32.exe) to turn on automatic logon, follow these steps:

Click Start, and then click Run.
In the Open box, type Regedt32.exe, and then press ENTER.
Locate the following subkey in the registry:
HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersionWinlogon
Double-click the DefaultUserName entry, type your user name, and then click OK.
Double-click the DefaultPassword entry, type your password, and then click OK.NOTE: If the DefaultPassword value does not exist, it must be added. To add the value, follow these steps:
On the Edit menu, click New, and then point to String Value.
Type DefaultPassword, and then press ENTER.
Double-click DefaultPassword.
In the Edit String dialog, type your password and then click OK.
NOTE: If no DefaultPassword string is specified, Windows automatically changes the value of the AutoAdminLogon key from 1 (true) to 0 (false), disabling the AutoAdminLogon feature.

On the Edit menu, click New, and then point to String Value.
Type AutoAdminLogon, and then press ENTER.
Double-click AutoAdminLogon.
In the Edit String dialog box, type 1 and then click OK.
Quit Registry Editor.
Click Start, click Shutdown, and then type a reason in the Comment text box.
Click OK to turn off your computer.
Restart your computer. You can now log on automatically.
Notes To bypass the AutoAdminLogon process and to log on as a different user, hold down the SHIFT key after you log off or after Windows restarts.

Registry change will not work if the “Logon Banner” is defined on the server either by a Group Policy object (GPO) or by a local policy. When policy is changed to not impact server, the feature works as expected.

An interactive console logon that has a different user on the server changes the DefaultUserName registry entry as the last logged on user indicator. AutoAdminLogon relies on the DefaultUserName entry to match the user and the password. Therefore, AutoAdminLogon may fail. You may configure a shutdown script to set the correct DefaultUserName entry for AutoAdminLogonAs. For more information, click the following article number to view the article in the Microsoft Knowledge Base:

119364
(http://support.microsoft.com/kb/119364/ )
AutoAdminLogon loses DefaultUserName

Error Installing a Botched Installation of VMware Tools

A previous installation of VMware Tools has been detected.
The previous installation was made by the tar installer (version 4).

Keeping the tar4 installer database format.

You have a version of VMware Tools installed. Continuing this install will
first uninstall the currently installed version. Do you wish to continue?
(yes/no) [yes]

If you select yes, the following error message appears:
Error: Unable to find the binary installation directory (answer BINDIR)
in the installer database file “/etc/vmware-tools/locations”.
Uninstall failed. Please correct the failure and re run the install.

Execution aborted.

To solve this issue, remove the /etc/vmware-tools/locations file and reinstall VMware Tools.

Removing Syslogd Installing Rsyslog and Configure to Splunk

yum shell
remove sysklogd
install rsyslog
run
exit

vi /etc/rsyslog.conf
paste in the below:
# ### begin forwarding rule ###
# The statement between the begin … end define a SINGLE forwarding
# rule. They belong together, do NOT split them. If you create multiple
# forwarding rules, duplicate the whole block!
# Remote Logging (we use TCP for reliable delivery)
#
# An on-disk queue is created for this action. If the remote host is
# down, messages are spooled to disk and sent when it is up again.
$WorkDirectory /var/lib/rsyslog # where to place spool files
$ActionQueueFileName fwdRule1 # unique name prefix for spool files
$ActionQueueMaxDiskSpace 1g # 1gb space limit (use as much as possible)
$ActionQueueSaveOnShutdown on # save messages to disk on shutdown
$ActionQueueType LinkedList # run asynchronously
$ActionResumeRetryCount -1 # infinite retries if host is down
# remote host is: name/ip:port, e.g. 192.168.0.1:514, port optional
*.* @@your splunk server:514
# ### end of the forwarding rule ###

chkconfig rsyslog on
service rsyslog restart

VMware Weird Latency Dell R815 Broadcomm Nic

So we were having this weird latency issue with our new R815’s and the Broadcomm nics utilizing iSCSI on a segregated lan.

Turns out we needed the BCM-NetXtremeII-5.0-offline_bundle-940344.zip driver imported into update manager, a reboot later, we were all happy!

Cron Jobs on VMware Hosts

This explains how to add a cron job to VMware in such a way that it will still be there after reboots.

Having enabled ssh access to your ESX/ESXi server, ssh in as root.

First, add the cron job to the root crontab:

1. Edit /var/spool/cron/crontabs/root
2. Add the line (all on one line)
5 0 * * * /full/path/to/script arguments/with/full/path > /full/path/to/logfile 2>&1
3. When you quit, use Esc, :wq! to override the read only attribute.

For details of the meaning of “5 0 * * *” (5 minutes past midnight every day) read the man page for crontab(5) on any Unix/Linux server, or else on the web.

Now, add a command to /etc/rc.local to re-generate the cron job when ESX/ESXi reboots

1. Edit /etc/rc.local, using a command such as “vi /etc/rc.local”.
2. At the end of the file, add 3 lines (using “G” then “O” in vi). The first kills crond, the second adds the new cron job to the root crontab file, ad the third restarts crond:
/bin/kill $(cat /var/run/crond.pid)
/bin/echo ’5 0 * * * /full/path/to/script arguments/with/full/path > /full/path/to/logfile 2>&1′ >> /var/spool/cron/crontabs/root
/bin/busybox crond
3. Save and exit the editor (Press the “Esc” key then “:wq” then press “Return” in vi)
4. Run the command “auto-backup.sh” so that the change to /etc/rc.local survives a reboot.

Every time you change the cron job, remember to update /etc/rc.local as well and run the “auto-backup.sh” command to backup the new /etc/rc.local file.

Multi Processor VMware

If you change from a multi-processor system to a uni-processor system you need to manually change the HAL on the Windows server after the conversion.

To do this go into Device Manager after the machine first boots and discovers it’s new hardware and then click on Computer then right-click on the processor and select Update Driver. Then select Install from specific location and then Don’t search I will choose the driver to install. Then select show All compatible hardware and select the appropriate processor.

For example, if you went from a dual cpu to a single cpu then select ACPI uni-processor PC instead of ACPI multi-processor PC. You will need to reboot once you change this. To verify what HAL you are using you right-click your hal.dll in c:\windows\system32 and select the Version tab and select Internal Name and it should say halmacpi.dll for multi-processor acpi and halacpi.dll for uni-processor acpi.

Next clean up all the non-present hardware after the P2V conversion. To do this go to a CMD prompt and type SET DEVMGR_SHOW_NONPRESENT_DEVICES=1 and then DEVMGMT.MSC and then select Show Hidden Devices. Delete any old grayed out hardware. Next remove any vendor specific applications/drivers. For example on a HP server you should go to Add/Remove programs and remove any HP management agents, survey utility, array config utility, version control agent, etc.

Also check your NIC and make sure there are no vendor specific drivers there (ie. teaming). Check the Services to see if all there is anything vendor specific related there and disable any services that are.