Monday, November 12, 2018

vCenter Appliance Emergency Mode

So the server is in Emergency mode, Now what.

The easiest is to run the journalctl command and look for an obvious /dev/sda<number> failure in the log. If you find that, skip to the fix.


The Fix

just use
e2fsck -y /dev/sda<number>

And you should be fine.

Notes on cleaning up images before a template or VDI Master Image

Clean up, because your Mom really IS watching

As always, I put these notes out here for myself because I keep forgetting them and it's the easiest place to get to when I'm working on a task that isn't near my list of notes.

This is almost exclusively powershell. Easiest for most applications, the data is pieline driven so you can just keep feeding data from one command to the next. And they keep coming up with new stuff like the new network command in PS3.

NOTE: If these commands Don't work, then upgrade your machine, I mean really, let's at least TRY to keep our infrastructure current, OK.

Cleaning up the Trash can

Clear-RecycleBin

That's it. Could be simpler but you need an alias for it which takes 10 more lines.

Steps to Clear All Event Logs in Event Viewer in Windows 10


  1. Open Cortana, type Powershell and select Windows Powershell.
  2. Type the following command and press Enter.
  3. wevtutil el | Foreach-Object {wevtutil cl “$_”}
  4. The event logs will be cleared.
I run this as admin and I still get a few that don't clean out, but it gets the bulk of them.

Tuesday, July 31, 2018

Foray into Arduino

OK, so I'm taking a brief foray into the arduino world.
My son and I are working on a Halloween costume using arduino, specifically the Adafruit Playground Classic. So below are some notes on the project.

The processor:

Since the playground is not specifically called out in all command references, it is important to note:
  • ATmega32u4 Processor, running at 3.3V and 8MHz
  • MicroUSB port for programming and debugging with Arduino IDE
  • USB port can act like serial port, keyboard, mouse, joystick or MIDI

Sensors and Pins

  • 10 x mini NeoPixels, each one can display any rainbow color
  • 1 x Motion sensor (LIS3DH triple-axis accelerometer with tap detection, free-fall detection) SPI Pins, CS Pin on PIN 8 and Interrupt on PIN 7
  • 1 x Temperature sensor (thermistor) PIN A0
  • 1 x Light sensor (phototransistor) PIN A5
  • 1 x Sound sensor (MEMS microphone) PIN A4
  • 1 x Mini speaker (magnetic buzzer) PIN 5
  • 2 x Push buttons, left and right PIN 19 Left, PIN 5 Right (Read HIGH)
  • 1 x Slide switch PIN 21 LOW Left, HIGH right
  • 8 x alligator-clip friendly input/output pins GPIO PINS 0, 1, 2, 3, 6, 9, 10, 12
    Includes I2C, UART, and 4 pins that can do analog inputs/PWM output
  • All 8 pads can act as capacitive touch inputs
  • Green "ON" LED so you know its powered
  • Red "#13" LED for basic blinking  PIN 13
  • Reset button

  • D10 / A10 - This pin can be digital I/O, or Analog Input. This pin has PWM output
  • D9 / A9 - This pin can be digital I/O, or Analog Input. This pin has PWM output.
  • D6 / A7 - This pin can be digital I/O, or Analog Input. This pin has PWM output.
  • D12 / A11 - This pin can be digital I/O, or Analog Input.
  • D1 - This pin can be digital I/O, it is also used for Hardware Serial Transmit, and can be an interrupt input.
  • D0 - This pin can be digital I/O, it is also used for Hardware Serial Receive, and can be an interrupt input.
  • D2 - This pin can be digital I/O, it is also the I2C SDA pin, and can be an interrupt input
  • D3 - This pin can be digital I/O or PWM output, it is also the I2C SCL pin, and can be an interrupt input
  • D4 - Left Button A
  • D5 - Speaker PWM output
  • D7 - Accelerometer interrupt
  • D13 - Red LED
  • D17 - Built-in 10 NeoPixels
  • D19 - Right Button B
  • D21 - Slide Switch
  • A0 - Temperature Sensor
  • A4 - Microphone sound sensor
  • A5 - Light Sensor





Friday, July 20, 2018

Remove VMware Horizon View VMs and Desktop Pools stuck in Deleting stage.

I have had several times where the Horizon Pool will not delete all the way, the VMs are stuck in a deleting phase (note: the VMs are gone from vCenter, just not from the inventory). That makes the Desktop Pool get stuck and Chaos ensues.

Most Recently I got stuck for several days before I found this article. I have made some additions, changes and comments to the process, but credit to Jacob Gardiner for the screen shots and SQL deep dive.

From Jacob's Blog - My Comments and suggestions below are in BLUE and RED

I have recently experienced an issue with VMware View Desktop Pools, I tried to remove a Desktop Pool but it did not successfully complete and it had been stuck in the ‘Deleting’ stage. You will need to complete the following steps to successfully remove these Desktop Pools. (You may not need to do all of this, if your VMs are gone and it's just the inventory in the admin tool, the ADSI will suffice)
Firstly you will need to remove the machines from the ADAM Database on the Horizon View Connection Server. We will need to use ADSI Edit to complete the removal of these objects.

NOTE: This assumes that you are RDPed into the Connection Manager Server. I am a BIG proponent of Admin VMs with all of your remote tools on them and NEVER RDPing int a server unless it is necessary. I HIGHLY Recommend running ADSI Edit from your Admin VM and using the following:
Select or Type a Distinguished Name or Naming Context – dc=vdi,dc=vmware,dc=int
Select or Type a Domain or Server 
  Actual Server – NET-00-HCM-01:389
You will need to navigate to ADSI Edit, You can complete this by typing adsiedit.msc in to a Run box. You will now need to select Action, then Connect To. You will need to put in the following information in the connection settings.
Select or Type a Distinguished Name or Naming Context – dc=vdi,dc=vmware,dc=int
Select or Type a Domain or Server – localhost:389
VMware View ADAM Connection Settings - Removing VMware Horizon View Desktop Pools Stuck In 'Deleting' stage
Once connected you will see the following in the left hand column.
ADSI Edit Default Naming Context - Removing VMware Horizon View Desktop Pools Stuck In 'Deleting' stage
We now need to create a query to search for the machines that we are trying to remove from the database. We will now need to create a query to find the machines that are in the ADAM Database. You can complete this by right clicking ‘Default Naming Context’ and selecting New –> Query. You need to fill in the New Query box with the following information –
Name – This can be a name of your choice.
Root of Search – This needs to be the ‘Servers’ folder.
Query String – (&(objectClass=pae-VM)(pae-displayname=VirtualMachineName))
The VirtualMachineName above should ACTUALLY BE your VM Name, or a wild card like NET-VMX-1* that gets just the VMs you need to delete. Most people don't need to delete all of them.
ADAM VM Query - Removing VMware Horizon View Desktop Pools Stuck In 'Deleting' stage
I would advise using the * Icon as a Wildcard for the VirtualMachineName if you are trying to remove multiple entries at once as this will show them all.
ADAM VM Query Wildcard - Removing VMware Horizon View Desktop Pools Stuck In 'Deleting' stage
You will now be presented with the following results in the VM Query section.
ADAM VM Query Results - Removing VMware Horizon View Desktop Pools Stuck In 'Deleting' stage
You will now need to locate the relevant VM’s that you want to remove. The specific fields you should be looking for is the Description and the ipHostNumber field. These fields are the most useful for identifying the virtual machines required. Scroll down in the list and actually find the PAE-DisplayName field. That is the actual name of the VM and is MUCH better for finding your errant VM.
Identify VM - Removing VMware Horizon View Desktop Pools Stuck In 'Deleting' stage
You can now right click the entry and select ‘Delete’ as required.

Normally, I can stop here. Go back and look at the admin console and refresh. The Pool should be gone. If not, then proceed from here.
You will now need to login to the SQL Management Studio to the View Composer Database. In my deployment the View Composer is on the VMware vCenter Server. Login with the relevant credentials you used when you installed VMware View.
Login to Database - Removing VMware Horizon View Desktop Pools Stuck In 'Deleting' stage
You will now need to navigate to the VMware View Composer Database –> Tables –> dbo.SVI_VM_NAME
You will need to right click this and select ‘Edit Top 200 Rows’
SQL dbo.SVI VM NAME - Removing VMware Horizon View Desktop Pools Stuck In 'Deleting' stage
Right click and select ‘Delete’ to the selected VM’s that you want to remove from the database. After this the Desktop Pool was removed in Horizon View.
You should now remove the Computer Account from AD.
You can then remove the VM/VM’s from vCenter by right clicking the VM and selecting Delete from Disk.
To find more information on this process you can follow these KB’s.

Thursday, May 24, 2018

Removing Modern Apps from Win10 Gold Image

You are creating a gold image. You are disconnected from the internet. You want to get rid of all the non-corporatte, interent grabbing apps on there.

I looked at this post https://gal.vin/2017/04/06/removing-uwp-apps-mdt/

And found some great tips. Look at the list of apps that can not be removed. You desperately want to, but don't be fooled.

I added an out-gridview command to mine.

Get-AppxPackage -allusers | out-gridView -Mode Multiple | remove-AppxPackage
It simplifies the whole script. Since you know the App name is valid, no error checking is needed.

Get-AppxProvisionedPackage -Online | Out-GridView -Mode Multiple | Remove-AppxProvisionedPackage -Online

And the same for the Provisioned Packages.

Remove snapshots on vCenter easily

If you have a bunch of snapshots all over your environment and you need to pick only a few to remove, here's an easy way.

I was looking through some posts and found this to get started. http://pipe2text.com/?page_id=251

I modified it a bit to get the items I needed.

We had an issue where the NetApp snap manager process failed and stayed in the event log at 44% or 59%. Rebooting the vCenter server worked, but we were left with smvi_ snapshots all over the place.

$snaps = get-vm svr-00* | get-snapshot | where {$_.descrption -like "*201804*" | select-object vm,name,description | out-gridview -mode multiple
foreach ($snap in $snaps) {
get-vm $snap.vm | get-snapshot $snap.name -RunAsync -verbose -confirm:$false
}

You can change the svr-00* to be a subset of your VMs or remove it to get all of them.
You can modify "*201804*" to filter for a particular description.

Gives you a nice list, you can sort by column, pick the ones you want and clean it up.

If you want to get fancy, you can change the items to variable,s get some input from the user and plop it into the code. But I'll let you get fancy, here is the quick and dirty to get you started.

installing ESX 5.5 on HP Gen9 with internal SD Card

So for those of you still on 5.5 and not taking the leap to 6.5 (which is great since you can simply upgrade your whole Windows vCenter server to the vCenter appliance in one swift motion), we are going to look at the issues of Gen9 servers with ESX 5.5

First of all the SD Card, the smallest you can get from HP right now is 8GB, that I'm sure will increase again in a week or two. But it's more than enough for ESX.

So when the installed finds your storage, you'll see HP ILO SD Card, that is it. It bothered me because it said ILO and the ILO itself has an embedded installer folder and a user data folder that can be enabled, but that is the one to pick.

UPDATE: for the Gen10 servers it is USB 3.0 CDW weird names it finds, but knowing is half the battle.