Showing posts with label vSphere. Show all posts
Showing posts with label vSphere. Show all posts

Tuesday, 26 March 2013

vSphere allows use of a RAW-mapped logical drive on two VMs in wrong way

I didn't write anything on my blog for a quite some time, mostly because no really interesting things happened.

However, I face a weird vSphere behavior, after which I had to recover two file-servers. vSphere allowed me to RAW-map an FC-connected logical drive to a VM, despite it was already mapped to another one.

Well, it was our bad, that we didn't mark this logical drive properly, so when I took a look into DS Storage manager, it showed me the name of this drive something like "DATA3". After I asked my colleagues, they told me that this is probably an unused piece of the storage.

Actually I was going to create another logical drive in order to extend LVM volume on one of ours Linux file-servers. So, being completely sure that vSphere will not allow me to RAW-map an already used logical drive, I've mapped this one to the VM, and have extended the file-system, adding those 2TB.

Because this was a production server, I've performed online resize (reiserfs), after re-mounting in r/o mode of course.

Two days after, our monitoring system notified me, that there are serious FS errors on this server. Well, I was quite surprised, because I did extend reiserfs partitions online before with no issues. However, thinking that this is a bug of partially-supported (?) FS connected with resizing relatively big partitions (3TiB to 5TiB), I've unmounted this volume and have performed a reiserfsck.

After recovery has completed (few errors were fixed) I've mounted it back and was happy..... until next day...


Next day I was notified about errors again. wtf? Performing reiserfsck again... After it is finished I was recommended to... rebuild the whole tree... s**t! Almost 3TB of data, several millions of small files on a shared SATA storage....


OK, needed means needed... Starting rebuild. At the same moment I began to recover data from backup to another partition - in order to compare differences. And at this moment.......


- "Hello, I cannot access home folders. Can you check please?"
- "One moment..... Uhm.... what the...?! Seems like we have a H/W failure, I'll call you back.."

Home folders on a windows file-server disappeared.... Drive manager shows 2TiB drive with "Unknown" partition.......

It was a blood-freezing lightning in my head!


Switching to the vSphere client console, Windows VM settings -> Hard disk 2 ->  Manage Paths.... Error!


vCenter somehow "forgot" about this RAW-mapping, and treated the logical volume as a free! S**T!


Recovery procedure

At this moment the FS tree rebuild has been completed. Switching the recovered partition to read-only and starting rsync to a new one. Luckily we have enough free space.

Recovery from backup process took a lot of time, because (of course) data was fragmented on different tapes, so most of time has been spent on watching the status "changing tape"...

Windows server... Disaster... Precisely few days before (in order to optimize our backups) the old backup has been completely removed, and a new configuration was in progress of preparation. Shame on ours backup administrators...

So, after rsync process on the Linux server has been completed, I've disconnected the "problematic" drive from the Linux server and began to scan it on the Windows server with a tool named Restorer2000 ultimate. Despite I've choose to search only for NTFS partitions, after scan was finished I had a few thousands of potential FS structures. So it took some time until I find the proper one, and the recovery process has began.

I like NTFS for it's recovery possibilities. I was able to recover almost all of 1.6TB data, except several damaged files.

It was the same on the Linux file-server. Checksum comparison with the backup copy showed no differences.

At the end we loose not so much data as we could. I cannot say that it was a new experience to me, because I had even worse disasters in my practice. But (again) I make sure of necessity of the proper labels!

PS: Unfortunately, under high users pressure I had no time to record everything, so currently I have not enough data to submit a bug to VMWare. And I have no free resources to try to reproduce it.

Wednesday, 5 December 2012

vSphere: A general system error occurred: Authorize Exception

This article may help you, if  solution from VMware Knowledge Base titled vCenter Server login fails with error: A general system error occurred: Authorize Exception not helps.

Symptoms (as from KB)

  • vCenter Server services are running, but a user that was previously able to log into vCenter Server no longer can
  • A local admin account is able to log in, but domain users cannot
  • You see this error:

    A general system error occurred: Authorize Exception

Additionally

  • Re-joining to domain don't help
  • Your primary (and secondary)  Domain Controllers which was used before were changed
  • C:\Program Files\VMware\Infrastructure\SSOServer\webapps\ims\WEB-INF\classes\krb5.conf contains wrong kdc entries.
    NB: Don't try to edit this file. It's automatically generated.

Cause

  •  Single-Sign-On service uses old DC name(s) when binds to Active Directory

Resolution

  1.  Install vSphere WebClient (don't forget that you should use admin@System-Domain username in order to connect it with SSO)
  2. Login to Web Client (https://vcenter.company.com:9443/vsphere-client/) using SSO admin account - admin@System-Domain
  3. On Administration page select Configuration menu under Sign-on and Discovery section
  4. Select the desired identity source (type - Active Directory), click Edit and write down (printscreen) all of the connection options
    Want to point out, that in my case, changing server URLs has no effect - no changes was saved after OK was pressed, so...
  5. Remove old identity source and add a new one, with the same parameters, but with new server URLs
  6. Done



Not important

To be honest - it was the most interesting issue for last couple of month. Mostly because any other issue I faced was already solved by someone else, so any problem was solved by following the obvious scenario: Problem -> logs - > google -> solution.

Now I have to switch on my imagination, because all solutions for "Authorize Exception" problem suggested to re-join to AD and/or fix AD/DNS problems. So we spent several hours fixing non-existing problems.

Well, we knew that Domain Controllers were changed, but we forgot completely about SSO, and nobody knew/remember that SSO uses it's own configuration (based on MIT kreberos) in order to bind to AD.

But even when the problem was located, I've spent next couple hours examining SSO logs and trying to find where AD discovery configuration can be changed. It's a pity, that it's not possible to configure by some CLI (at least I didn't find anything).

Hope this article helps. If so, I would appreciate if you consider to leave a comment.

Saturday, 13 August 2011

Preconfigured ESXi on USB flash drive

It was quite long after my last post. Too much work and almost no free time. However, I've learned few interesting things, and I'm going to share them. And the first one - about the ESXi deployment.

We have up to 20 ESX nodes in our offices worldwide. And sometimes it was a hard way to deploy them remotely, using local supporters help. Moreover, even in our datacenter in place where we're sitting, it's quite uncomfortable to provide some maintenance if you forgot to take warm closes.

I knew there is a possibility to install ESXi on a USB flash drive. But I was interested in pre-deployment. The way is happened to be very easy.
To deploy a clean installation, all you need, is just to:
a) download the ESXi iso, for example here.
b) extract a file, named imagedd.bz2
c) unbzip2 it :)
d) deploy it on your flash drive. I used dd under the Linux like following:

# dd if=imagedd of=/dev/sdb bs=1M
(please, check if your flash drive is under /dev/sd?. if you just use the string above, you can destroy the existing data! Use it only if you understand what it means and on your own risk!)

Done! Now you have a fresh bootable flash drive with ESXi unconfigured yet.
Next thing I did, is just connect it to some laptop (I had Lenovo G550) and boot up.You can use any PC or laptop with H/W Virtualization support. The only issue I had with this budget laptop using ESXi, is that the keyboard doesn't work. So I just have plugged an external one. Now, you can configure the network and make some configuration remotely, with vSphere client, that is not possible to do from the console.

The main problem we had, is that after you select several interfaces to be used for NIC teaming (or portchannel on the Cisco switch side), ESXi that by default it uses "Route based on the originating virtual port ID". And that doesn't work well with the Cisco default configuration, which requires to be set the "Route based on IP hash" (or src-dst-ip hash).
Important note, for those who faced that NIC teaming is not working correctly! In difference to ESX 4.0, which we had used before, in ESXi 4.1. we found, that it makes NIC teaming configuration of management interface not as a default (inherited from the virtual switch config), but configures it independently! This strange behavior cost us 2 hours before we found this. Because we checked many times the NIC Teaming configuration of vSwitch and had no idea that Management Network has it different.

Next I configured all DNS settings, all VM and VMkernel networks, NTP, etc... Then I closed vSphere client and made the final network configuration to be used in the datacenter. Shutdown.... Ready!

All I need after that, is just go to the server room (or send a flash drive to the remote office), plug flash drive to the server (In case of IBM x3650 M2 and M3 there is a special USB port an a RAID controller for that purpose), boot from USB (in case of the mentioned IBM servers - boot from HardDisk1), and select the network interfaces to be for the Management Network after ESXi boot.

That is the way I do the ESXi deployment now. If you have any suggestions - you're welcome.