• Blue Screen with Bug Check 50 on ESXi 5.x

    Some critical VMs got blue screen in last few weeks. After working with OS and hardware vendor, we figured out the root cause eventually. It’s a CPU problem related to Intel v2 CPU of E3, E5 and E7 families. The detail information is documented in VMware KB Windows 2008 R2 and Solaris 10 64-bit virtual machines blue screen or kernel panic when running on ESXi 5.x with an Intel E5 v2 series processor.

    (more…)


  • 502 Bad Gateway after upgrading Debian to latest version

    There is a dash vulnerability on Debian, please following the steps below to check your system:

    (more…)


  • Firmware upgrading is pending on install in progress on HP ESXi 5.5 blade by HP SUM

    In my post HP Blade Firmware Upgrading Best Practices for ESXi Host I mentioned HP released firmware and drivers by SPP image.  I have set my ESXi 5.5 baseline to SPP2014.06 as I have tested it in my lab environment. Looks like stable.

    (more…)


  • FC Traffic Drops After IOM Reset/Reseat/Cable Pull or UCS Upgrade

    I just found a Cisco KB descripts a firmware issue may impact to ESXi FC storage performance. Please have a look whether your Cisco UCS system firmware is 2.1(2a), 2.1(2c), or 2.1(2d).

    (more…)


  • How to get HP ProLiant blade server and enclosure information

    An enterprise infrastructure administrator needs to run plenty of reports for firmware, software version, or any kind of infrastructure data in their day-to-day operation. Some vendors provide powerful tools to pull out data from their solution, but what if you don’t have such tools? It is pain to get data manually especially for large number of servers. I’m going to share my trick to you. I’ll use HP ProLiant blade system for example, as it’s very common case in enterprise datacenter.

    (more…)


  • 如何删除Raspberry Pi上安装的软件

    做为一位Raspberry Pi(树莓派)的新手,面对这个庞大的系统,真心不知道从何下手。在网上搜各种有关Raspberry Pi的信息,发现只有英文文章能比较详尽的介绍怎么使用它,中文的信息要么是从英文翻译过来,不知所云;要么蜻蜓点水一般感觉只有高高手才能看得懂。

    我会尝试把我这个新手学到的东西记录在我的博客里,希望对Raspberry Pi中文社区有所贡献。

    感觉自己有些技术洁癖,不喜欢系统上被预装各种软件,比如当我打入python时,会提示我有2.7,3.0,3.2三个版本存在于我的系统里!所以我很好奇我的Raspberry Pi上到底已经内置了哪些软件,怎么删除这些不需要的软件。其实这个问题已经困扰我很久了,由于一直使用Windows,对于添加删除程序的概念一直是 规范、整洁、方便。没想到Linux的软件是如此的自由,以至于我根本不知道哪些应该删除,哪些不应该。

    幸好现在的Debian发行版本已经内置了很多好的工具帮我解决这个问题!我的Raspberry Pi上安装的是官方推荐的raspbian,这是Debian的衍生版本,几乎所有的命令都和Debian下一致。你可以在Raspberry Pi的下载页面找到这款系统,当然你还可以选择很多其他的系统。

    OK,言归正传,说到删除,我们需要先知道系统里都安装了哪些软件,下面这个命令可以检索出系统内的所有软件。

    dpkg-query -l | grep 软件名字

    dpkg-query 命令 是用于检索安装包的。

    -l 参数 表示列出所有的包。

    | 管道标识符 表示传递列出的所有包到 管道标识符后边的命令中。

    grep 命令 是用于过滤

    软件名字 参数 表示你要找的安装包名字

    举例, 列出所有名字里含python的安装包:

    dpkg-query -l | grep python

    用上边的方法列出你要找的包后,下一步我需要删除不需要的软件了。

    apt-get –purge remove 软件名字

    apt-get 命令 是操作软件的命令

    –purge 参数 表示将软件相关的配置文件一并删除

    remove 参数 表示删除软件

    软件名字 参数 表示你要删除的软件,也可以是多个名字,用逗号隔开

    举例,删除chromium和所有相关的软件:

    apt-get –purge remove chromium,chromium-browser,chromium-inspector,chromium-l10n

    在这个例子里,我一次性删除了chromium和他相关的软件,比如语言包、页面检测程序等。Linux里的软件给你最大的透明度,一个软件其实有可能是由多个小程序组成的,所以你会看到好几个含有chromium关键字的包。

    另外,也许你会看到类似libxxxx这样开头的包,这种一般都是某个主程序的库文件,在你删除主程序时候他会自动删除这些库文件。

    最后,运行这个命令删除不再需要的零散软件包

    apt-get autoremove

    apt-get是一个强大的工具,他甚至可以用来更新系统,我在另外一篇文章《Upgrade raspberry pi on fly》中有介绍怎么实现。


  • Upgrade raspberry pi on fly

    This article is for the new users whom just like me! 🙂
    I got a Raspberry Pi about half years ago, I’m pretty new in Linux world, so I rebuilt my pi over and over again whenever there was a new release…it takes lot of time to do it.
    Thanks Safari(a online library for IT guys). Today I found a new way to do it on fly! Just run following two commands it will upgrade system automatically.

    #apt-get update
    This command line updates the latest repository information.

    #apt-get upgrade
    It’s upgrade all older packages to latest version.

    It may takes long time to complete upgrading, you’d better make sure the SSH alive during that time.


  • How to Delete a Pending Host from SCVMM 2012 R2

    A Hyper-V host shows Pending status under VMs and Services section, the host invisible under Fabric section.

    You may experience following symptoms when you re-add the Hyper-V host to SCVMM 2012 R2.

    There were no computers discovered based on your inputs. Please verify the following:

    • Your Virtual Machine Manager Server service account has at least read access to the Active Directory domain you requested to discover.
    • Your Virtual Machine Manager Server has access to the computer in the discovery scope.
    • The servers you specified are powered on and running.
    • You specified valid credentials to access the servers.
    • The user account that you specified has Administrator privileges on the Windows servers to be discovered.
    • The servers you specified are already managed by Virtual Machine Manager.

    You may see following error when you try to delete the Hyper-V host from SCVMM 2012 R2.

    Error (2606)

    Unable to perform the job because one or more of the selected objects are locked by another job.

    Recommended Action

    To find out which job is locking the object, in the Jobs view, group by Status, and find the running or canceling job for the object. When the job is complete, try again.

     

    That’s because the Hyper-V host was not added to SCVMM 2012 R2 properly when you first time add it to SCVMM 2012 R2.

    Variously reason lead to this issue. It cannot be fixed by restart 2012 R2 services, reboot Hyper-V host, reboot SCVMM 2012 R2 server or force delete by PowerShell command Remove-SCVMHost.

    You have to manually delete the host record in SCVMM 2012 R2 SQL database.

    HostID is unique ID correspond with each Hyper-V host in SCVMM 2012 R2 database, so basically we need to delete everything related to the target HostID.

    The only article about that is How to manually remove a host from the VMM database, but it’s for VMM2008. If you take a look the tables of SCVMM 2012 R2 database, it’s more complicate. I would like to share how I did it. Since everybody may have different situation, I’m going to show you a generic way.

    1. Create a temp share folder on SQL database server. Grant READ/WRITE permission to EVERYONE.
    2. Launch SCVMM 2012 R2 console.
    3. Go to SettingsGeneralBackup.
    4. Enter the share path then click OK to backup SCVMM 2012 R2 database.
    5. Launch SQL Management Studio.
    6. Select SCVMM 2012 R2 database.
    7. Open table tbl_ADHC_Host and find out HostID of the target host.
    8. Right click the database and select New query.
    9. Run query below. (Replace ‘HostID’

      by real one)
      SELECT * FROM tbl_ADHC_Host WHERE (HostID = ‘HostID’)
    10. It returns the host records in tbl_ADHC_Host table.

    You can run following query to try deleting basic information of the host. (Replace ‘HostID’
    and @computername by real one)

    DELETE FROM tbl_ADHC_HostNetworkAdapter WHERE (HostID = ‘HostID’)

    DELETE FROM tbl_ADHC_VirtualNetwork WHERE (HostID = ‘HostID’)

    DELETE FROM tbl_ADHC_HostVolume WHERE (HostID = ‘HostID’)

    DELETE FROM tbl_ADHC_HostDisk WHERE (HostID = ‘HostID’)

    DELETE FROM tbl_WLC_PhysicalObject WHERE (HostId = ‘HostID’)

    DELETE FROM tbl_WLC_VObject WHERE (HostId = ‘HostID’)

    DELETE FROM [tbl_ADHC_AgentServerRelation] WHERE AgentServerID = (select top 1 AgentServerID from tbl_ADHC_AgentServer where Computername = @computername)

    DELETE FROM [tbl_ADHC_AgentServer] WHERE AgentServerID = (select top 1 AgentServerID from tbl_ADHC_AgentServer where Computername = @computername)

    DELETE FROM tbl_ADHC_AgentServer WHERE (ComputerName = @computername)

    DELETE FROM tbl_ADHC_ISCSIHbaToTargetMapping where ISCSIHbaID in (select HbaID from tbl_ADHC_HostBusAdapter where(HostID = ‘HostID’))

    DELETE FROM tbl_ADHC_HostInternetSCSIHba where ISCSIHbaID in (select HbaID from tbl_ADHC_HostBusAdapter where(HostID = ‘HostID’))

    DELETE FROM tbl_ADHC_HostBusAdapter where (HostID = ‘HostID’)

    DELETE FROM tbl_ADHC_Host WHERE (HostID = ‘HostID’)

    Since a Hyper-V host has lot of hardware, such as network adapter, HBA, virtual network, logical network, WWPN…etc. The query above may not able to delete all related information in database, it returns similar error below:

    Msg 547, Level 16, State 0, Line 1

    The DELETE statement conflicted with the REFERENCE constraint “fk__NetMan_LogicalNetworkDefinitionToHostGroup__ADHC_HostNetworkAdapter”. The conflict occurred in database “VirtualManagerDB”, table “dbo.tbl_NetMan_HostNetworkAdapterToLogicalNetwork”, column ‘HostNetworkAdapterID’.

    Then you have to chase down related key from table NetMan_LogicalNetworkDefinitionToHostGroup and delete the related information first.

    I’m not a DB expert, so I have to chase down the error message one by one and manually delete records from tables, you may have better idea. J

    Finally DELETE FROM tbl_ADHC_Host WHERE (HostID = ‘HostID’) should be able to execute successfully, then restart SCVMM 2012 R2 service and login console. You will see the pending Hyper-V host disappeared.

    ****************************************************************************

    Updated – 7/22/2014

    A script can completely delete a host from SQL DB.

    Please backup database before run it!!!!!

    +++++++++++++++++++++++++++++++++++++++++++++++

    USE VirtualManagerDB;                           // VirtualManagerDB is your database name.

    DECLARE @DeleteHostId GUID;

    SET @DeleteHostId = ‘<HostID>’            //HostID is the one you want to delete.

    PRINT N’Deleting host with GUID ‘ + RTRIM(CAST(@DeleteHostID AS nvarchar(50)))

    PRINT N’Getting host cluster GUID’

    DECLARE @HostClusterID GUID;

    SET @HostClusterID =

    (

    SELECT HostClusterID FROM [dbo].[tbl_ADHC_Host]

    WHERE HostID = @DeleteHostId

    )

    IF (@HostClusterID IS NOT NULL)

    PRINT N’Retreived host cluster GUID ‘ + RTRIM(CAST(@HostClusterID AS nvarchar(50)))

    ELSE

    PRINT N’This host does not belong to a cluster’

    PRINT N’Deleteing physical objects’

    DELETE FROM [dbo].[tbl_WLC_PhysicalObject]

    WHERE HostId = @DeleteHostId

    PRINT N’Deleteing virtual objects’

    DELETE FROM [dbo].[tbl_WLC_VObject]

    WHERE HostId = @DeleteHostId

    PRINT N’Prepairing to delete host network adapters’

    DECLARE @HostNetworkAdapterCursor CURSOR;

    DECLARE @HostNetworkAdapterID GUID;

    SET @HostNetworkAdapterCursor = CURSOR FOR

    (SELECT NetworkAdapterID FROM [dbo].[tbl_ADHC_HostNetworkAdapter])

    OPEN @HostNetworkAdapterCursor

    FETCH NEXT FROM @HostNetworkAdapterCursor INTO @HostNetworkAdapterID

    WHILE (@@FETCH_STATUS = 0)

    BEGIN

    PRINT N’Prepairing to delete host network adapter with GUID ‘ + RTRIM(CAST(@HostNetworkAdapterID AS nvarchar(50)))

    PRINT N’Deleting logical network mapping for host network adapter with GUID ‘ + RTRIM(CAST(@HostNetworkAdapterID AS nvarchar(50)))

    DELETE FROM [dbo].[tbl_NetMan_HostNetworkAdapterToLogicalNetwork]

    WHERE HostNetworkAdapterID = @HostNetworkAdapterID

    PRINT N’Deleting IP subnet VLAN mapping for host network adapter with GUID ‘ + RTRIM(CAST(@HostNetworkAdapterID AS nvarchar(50)))

    DELETE FROM [dbo].[tbl_NetMan_HostNetworkAdapterToIPSubnetVLan]

    WHERE HostNetworkAdapterID = @HostNetworkAdapterID

    FETCH NEXT FROM @HostNetworkAdapterCursor INTO @HostNetworkAdapterID

    END

    CLOSE @HostNetworkAdapterCursor

    DEALLOCATE @HostNetworkAdapterCursor

    PRINT N’Completing host network adapters deletion’

    DELETE FROM [dbo].[tbl_ADHC_HostNetworkAdapter]

    WHERE HostID = @DeleteHostId

    PRINT N’Deleting virtual networks’

    DELETE FROM [dbo].[tbl_ADHC_VirtualNetwork]

    WHERE HostID = @DeleteHostId

    PRINT N’Deleting virtual switch extensions’

    DELETE FROM [dbo].[tbl_NetMan_InstalledVirtualSwitchExtension]

    WHERE HostID = @DeleteHostId

    PRINT N’Deleting host volumes’

    DELETE FROM [dbo].[tbl_ADHC_HostVolume]

    WHERE HostID = @DeleteHostId

    PRINT N’Deleting pass through disks’

    DELETE FROM [dbo].[tbl_WLC_VDrive]

    WHERE HostDiskId IN (SELECT DiskID FROM [dbo].[tbl_ADHC_HostDisk] WHERE HostID IN (SELECT HostID FROM [dbo].[tbl_ADHC_Host] WHERE HostID = @DeleteHostId))

    PRINT N’Deleting host disks’

    DELETE FROM [dbo].[tbl_ADHC_HostDisk]

    WHERE HostID = @DeleteHostId

    PRINT N’Prepairing to delete host bus adapters’

    DECLARE @HostBusAdapterCursor CURSOR;

    DECLARE @HostBusAdapterID GUID;

    SET @HostBusAdapterCursor = CURSOR FOR

    (SELECT HbaID FROM [dbo].[tbl_ADHC_HostBusAdapter])

    OPEN @HostBusAdapterCursor

    FETCH NEXT FROM @HostBusAdapterCursor INTO @HostBusAdapterID

    WHILE (@@FETCH_STATUS = 0)

    BEGIN

    PRINT N’Prepairing to delete host bus adapter with GUID ‘ + RTRIM(CAST(@HostBusAdapterID AS nvarchar(50)))

    PRINT N’Deleting fiber port mapping for host bus adapter with GUID ‘ + RTRIM(CAST(@HostBusAdapterID AS nvarchar(50)))

    DECLARE @FiberPortID GUID;

    SET @FiberPortID =

    (

    SELECT PortID FROM [dbo].[tbl_ADHC_FCHbaToFibrePortMapping]

    WHERE FCHbaID = @HostBusAdapterID

    )

    DELETE FROM [dbo].[tbl_ADHC_FCHbaToFibrePortMapping]

    WHERE FCHbaID = @HostBusAdapterID

    PRINT N’Deleting fiber port with GUID ‘ + RTRIM(CAST(@FiberPortID AS nvarchar(50)))

    DELETE FROM [dbo].[tbl_ADHC_FibrePort]

    WHERE PortID = @FiberPortID

    PRINT N’Deleting fiber channel mapping for host bus adapter with GUID ‘ + RTRIM(CAST(@HostBusAdapterID AS nvarchar(50)))

    DELETE FROM [dbo].[tbl_ADHC_HostFibreChannelHba]

    WHERE FCHbaID = @HostBusAdapterID

    PRINT N’Deleting any iSCSI entries for host bus adapter with GUID ‘ + RTRIM(CAST(@HostBusAdapterID AS nvarchar(50)))

    DECLARE @iSCSITargets TABLE

    (

    TargetID GUID

    )

    INSERT INTO @iSCSITargets (TargetID)

    SELECT TargetID FROM [dbo].[tbl_ADHC_ISCSIHbaToTargetMapping]

    WHERE ISCSIHbaID = @HostBusAdapterID

    PRINT N’Deleting iSCSI host bus adapter to target mapping for mapping for host bus adapter with GUID ‘ + RTRIM(CAST(@HostBusAdapterID AS nvarchar(50)))

    PRINT N’Deleting iSCSI host bus adapter with GUID ‘ + RTRIM(CAST(@HostBusAdapterID AS nvarchar(50)))

    DELETE FROM [dbo].[tbl_ADHC_ISCSIHbaToPortalMapping]

    WHERE ISCSIHbaID = @HostBusAdapterID 

    DELETE FROM [dbo].[tbl_ADHC_ISCSIHbaToTargetMapping]

    WHERE ISCSIHbaID = @HostBusAdapterID 

    DELETE FROM [dbo].[tbl_ADHC_HostInternetSCSIHba]

    WHERE ISCSIHbaID = @HostBusAdapterID

    PRINT N’Deleting iSCSI targets for host bus adapter with GUID ‘ + RTRIM(CAST(@HostBusAdapterID AS nvarchar(50)))

    DECLARE @iSCSITargetIDCursor CURSOR;

    DECLARE @iSCSITargetID GUID;

    SET @iSCSITargetIDCursor = CURSOR FOR

    (SELECT TargetID FROM @iSCSITargets)

    OPEN @iSCSITargetIDCursor

    FETCH NEXT FROM @iSCSITargetIDCursor INTO @iSCSITargetID

    WHILE (@@FETCH_STATUS = 0)

    BEGIN

    PRINT N’Deleting iSCSI targets with GUID ‘ + RTRIM(CAST(@iSCSITargetID AS nvarchar(50)))

    DELETE FROM [dbo].[tbl_ADHC_ISCSIHbaToTargetMapping]

    WHERE TargetID = @iSCSITargetID

    DELETE FROM [dbo].[tbl_ADHC_ISCSITarget]

    WHERE TargetID = @iSCSITargetID

    FETCH NEXT FROM @iSCSITargetIDCursor INTO @iSCSITargetID

    END

    CLOSE @iSCSITargetIDCursor

    DEALLOCATE @iSCSITargetIDCursor

    FETCH NEXT FROM @HostBusAdapterCursor INTO @HostBusAdapterID

    END

    CLOSE @HostBusAdapterCursor

    DEALLOCATE @HostBusAdapterCursor

    PRINT N’Completing host bus adapters deletion’

    DELETE FROM [dbo].[tbl_ADHC_HostBusAdapter]

    WHERE HostID = @DeleteHostId

    PRINT N’Prepairing to delete agent servers’

    DECLARE @AgentServerID  GUID;

    SET @AgentServerID =

    (

    SELECT AgentServerID FROM [dbo].[tbl_ADHC_AgentServerRelation]

    WHERE HostLibraryServerID = @DeleteHostID

    )

    PRINT N’Deleting agent server relations’

    DELETE FROM [dbo].[tbl_ADHC_AgentServerRelation]

    WHERE HostLibraryServerID = @DeleteHostID

    PRINT N’Deleting health monitor data for agent server with GUID ‘ + RTRIM(CAST(@AgentServerID AS nvarchar(50)))

    DELETE FROM [dbo].[tbl_ADHC_HealthMonitor]

    WHERE AgentServerID = @AgentServerID

    PRINT N’Deleting agent server with GUID ‘ + RTRIM(CAST(@AgentServerID AS nvarchar(50)))

    DELETE FROM [dbo].[tbl_ADHC_AgentServer]

    WHERE AgentServerID = @AgentServerID

    PRINT N’Deleting host GPUs’

    DELETE FROM [dbo].[tbl_ADHC_HostGPU]

    WHERE HostID = @DeleteHostId

    PRINT N’Deleting host’

    DELETE FROM [dbo].[tbl_ADHC_Host]

    WHERE HostID = @DeleteHostId

    IF (@HostClusterID IS NOT NULL)

    BEGIN

    PRINT N’Checking to see if any other hosts are joined to the same cluster’

    DECLARE @HostCount INT;

    SET @HostCount =

    (

    SELECT COUNT(*) FROM [dbo].[tbl_ADHC_Host]

    WHERE HostClusterID = @HostClusterID

    )

    PRINT N’There are ‘ + RTRIM(CAST(@HostCount AS nvarchar(50))) + N’ currently joined to the same cluster’

    IF (@HostCount = 0)

    BEGIN

    PRINT N’Deleting cluster disks’

    DELETE FROM [dbo].[tbl_ADHC_ClusterDisk]

    WHERE ClusterID = @HostClusterID

    PRINT N’Deleting cluster’

    DELETE FROM [dbo].[tbl_ADHC_HostCluster]

    WHERE ClusterID = @HostClusterID

    END

    ELSE

    PRINT N’This host is not the last host in the cluster, the cluster will be deleted upon the deletion of the last host.’

    END

    ELSE

    PRINT N’This host does not belong to a cluster, no clusters will be deleted’

    GO

     


  • PortChannel does not work on Cisco UCS Fabric Interconnect

    Whatever  you configure on MDS, whatever you configure on Cisco UCS FIs, whatever you do for port channel on both side, the Cisco UCS uplink ports always down with error message Initilize failed, or Error disabled.

    Congratulation! your device hit MDS firmware bug…https://tools.cisco.com/bugsearch/bug/CSCtr01652/?reffering_site=dumpcr.

     


  • Domain account locked out on vCenter Server

    That’s a very small problem but it struggles you if you are enterprise datacenter administrator. As you may know the best practices to run application is by service account. But sometimes  you may testing applications by your own domain account and forget remove it.

    Few days ago, my domain account locked out on domain controller. The audit report indicated it locked out by vCenter Server every 5 seconds. Then I logged in the vCenter Server, checked out Task SchedulerServicesTask Manager…etc. Nothing was running under my domain account. I stopped applications one by one on the vCenter Server and related plugin services. No help, I felt so frustrated!!!

    Here is how I figured it out eventually.

    1. Download TCPView from Microsoft website.
    2. Run it on the vCenter Server.
    3. Sort by Local Address.
    4. See which foreign address is connecting the vCenter Server.

    After the steps above I finally figured out that root cause was my VMware View LAB VM tried to authenticate on vCenter Server by my domain account and stored old password. I powered up the old VM few days ago.

    这可能是一个很小的问题,但如果你是企业级数据中心管理员,这个问题可能会很困扰你。如你所知在日常使用中最好用Service Account来运行应用程序。但是有时候你可能和我一样需要用自己的域帐号做一些测试但之后又忘记删除了。

    几天前,我的域帐号被域控制器锁定了。域报告显示我的帐号每5秒钟就会被vCenter服务器锁定一次。我在vCenter服务器上检查了任务管理器、服务、计划任务等等,并没有发现任何东西使用我的帐号。然后我将vCenter服务器上的所有服务、应用程序都停了,还是不行!

    最终我找到了问题原因,以下是方法:

    1. 从微软网站下载TCPView
    2. 在vCenter服务器上运行。
    3. 选择以Local Address本地地址)排序。
    4. 查看连接到vCenter服务器的Foreign Address外部地址)。

    最终原因是我几天前把一台旧的VM开机了,这台VM上是当时以我的域帐号安装的VMware View做测试用。