Tuesday, February 9, 2010

VM not showing up in Hyper V

Sorry for the cramped formatting on the directory views.
You can copy and paste the blockquoted sections and paste
them in Notepad and they spreadout just fine.


Ok, so during the holidays I decided to whip up a SharePoint 2010 beta VM to have a look around and see what's new and start getting a feel for the new and improved SharePoint. So I crank out a Hyper V of SP2010beta and play around a bit. The last thing I do is shut down the virtual server not save it. Then a month or so goes by while I get my SQL 2008 Developer study on and one evening (this evening) I decide to take a break from studying and go play with the SP2010beta VM again. Well, low and behold, I crank up Hyper V Manager and BAM! My VM is not showing up. Ok, no worries, I go dig around the net and find John Savill's post on just what I'm seeing(citation below) so I follow his suggested steps and get my little virtual playground back up and running.

So here is my question, what caused the corrupted XML link? Was it because I shut the virtual server down rather than saving it? Is there a "time to live" default setting for VM's that are shut down rather than saved? How can I prevent this?

At any rate, once again as a big believer in redundancy, here are the steps needed to restore a VM in HyperV Manager if it goes missing.


1. Open a command prompt as adminstrator
2. Navigate to the Hyper V default folder on your local machine.
C:\ProgramData\Microsoft\Windows\Hyper-V\Virtual Machines
3. From that directory you will see a symlink(hidden) to the missing VM's XML configuration file. It will look something like this;
Directory of c:\ProgramData\Microsoft\Windows\Hyper-V\Virtual Machines

02/09/2010 04:42 AM .
02/09/2010 04:42 AM ..
10/05/2009 11:19 AM 77A90856-CC14-4061-83A3-10919895F84D.xml
[G:\Virtual Machines\MCTS_Configuration_Server\MCTS\Virtual Machines\77A90856-CC
14-4061-83A3-10919895F84D.xml]
09/25/2009 01:35 PM 9AEFB72A-7525-4281-BA02-B84C7C753912
09/25/2009 01:56 PM 15,626 9AEFB72A-7525-4281-BA02-B84C7C753912.xml
02/09/2010 04:42 AM BDA15939-83E1-4C5D-A560-2F8F5D0D1E93.xml
12/28/2009 04:28 PM BDA15939-83E1-4C5D-A560-2F8F5D0D1E93.
xml [G:\Virtual Machines\SP2010\SP2010beta\Virtual Machines\BDA15939-83E1-4C5D-A
560-2F8F5D0D1E93.xml]

4 File(s) 15,626 bytes
3 Dir(s) 324,143,992,832 bytes free

c:\ProgramData\Microsoft\Windows\Hyper-V\Virtual Machines>

4. Run Mklink to re-establish the link to your XML configuration file
Mklink BDA15939-83E1-4C5D-A560-2F8F5D0D1E93.xml "E:\Virtual Machines\SP2010\SP2010beta\Virtual Machines\BDA15939-83E1-4C5D-A560-
2F8F5D0D1E93.xml"
5. If necessary, you may need to set the VM service account perms again.
icacls BDA15939-83E1-4C5D-A560-2F8F5D0D1E93.xml /grant "NT VIRTUAL MACHINE\BDA15939-83E1-4C5D-A560-2F8F5D0D1E93":(F) /L

Now for my particular instance I also noticed that my original drive path had changed somehow. I had the VM on my E: drive and the new bogus reference was to the G: drive. So I had to open up the XML file on my VM directory, in this case on my external drive and change the drive letter to get the VM to finally open.

So once I was finished my c:\ProgramData\Microsoft\Windows\Hyper-V\Virtual Machines directory looked like this;


Directory of c:\ProgramData\Microsoft\Windows\Hyper-V\Virtual Machines

02/09/2010 04:42 AM .
02/09/2010 04:42 AM ..
10/05/2009 11:19 AM 77A90856-CC14-4061-83A3-10919895F84D.xml
[G:\Virtual Machines\MCTS_Configuration_Server\MCTS\Virtual Machines\77A90856-CC
14-4061-83A3-10919895F84D.xml]
09/25/2009 01:35 PM 9AEFB72A-7525-4281-BA02-B84C7C753912
09/25/2009 01:56 PM 15,626 9AEFB72A-7525-4281-BA02-B84C7C753912.xml
02/09/2010 04:42 AM BDA15939-83E1-4C5D-A560-2F8F5D0D1E93.xml
[E:\Virtual Machines\SP2010\SP2010beta\Virtual Machines\BDA15939-83E1-4C5D-A560-
2F8F5D0D1E93.xml]
12/28/2009 04:28 PM BDA15939-83E1-4C5D-A560-2F8F5D0D1E93_bad.
xml [G:\Virtual Machines\SP2010\SP2010beta\Virtual Machines\BDA15939-83E1-4C5D-A
560-2F8F5D0D1E93.xml]
4 File(s) 15,626 bytes
3 Dir(s) 324,143,992,832 bytes free

c:\ProgramData\Microsoft\Windows\Hyper-V\Virtual Machines>


Notice the bogus G: SYMLINK as opposed to the now corrected E: SYMLINK.

Thanks to John Savill
http://windowsitpro.com/article/articleid/101212/q-how-can-i-add-virtual-machines-vms-to-the-hyper-v-console.html for this solution.

Tuesday, January 26, 2010

AdventureWorks2008

If you are preparing for the 70-433 exam AND you're using Microsoft SQL Server 2008 - Database Development Self Paced Training Kit AND you're running a full version of SQL 2008...

When you attempt to attached the AdventureWorks2008.mdf (page xx in the book) you will run into "SQL Server Error: 5120". The work around is to execute the following script in SQL Server Manager;

Note: Be sure to change the pathing to point to the location of the files on your system.

USE [master]
GO
CREATE DATABASE [AdventureWorks2008] ON
( FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10.SQL2008\MSSQL\DATA\AdventureWorks2008_Data.mdf' ),
( FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10.SQL2008\MSSQL\DATA\AdventureWorks2008_Log.ldf' ),
FILEGROUP Documents CONTAINS FILESTREAM (NAME = Documents, FILENAME=N'C:\Program Files\Microsoft SQL Server\MSSQL10.SQL2008\MSSQL\DATA\Documents')
FOR ATTACH
GO

Anyone with the technical explantion of why, please comment for the benefit of the community.

Thanks to
http://geekswithblogs.net/influent1/archive/2009/06/09/132711.aspx for this solution.

Tuesday, October 23, 2007

WSS Contributor Permissions

Ok so you have set up your Site collection and you have a site that you want folks to be able to add items to say a calendar and an announcement web part but you don't want them to be able to modify the web part on the page itself. It's a simple set-up just not one explicitly defined in the general/basic books/sites out there. Here's the steps;

1. Create the site and select "use unique permission" rather than inherhit from parent.

2. Create the calendar list and the announcement list and place a view on your site default page.

NOTE: By doing steps 1 and 2 in order you have accomplished the following: the site has specific Owner, Member and Reader groups and the two lists are inheriting permissions from the site.

3. Edit the permissions of the lists(by doing this you break inheritance from the site) but you don't have to change any permissions, you just want to break inheritance so any changes you make on the site level do not propigate down to the lists.

4. Now at the site level modify the Member group to read only.

By doing these 4 steps you keep the ability for the Member to be able to add, edit or delete items in the list but they no longer can Modify the web part itself on the page.

Good luck and Happy SharePointing

Tuesday, September 4, 2007

SPS Naming Conventions

Site Names

In WSS Site Names may not contain the following characters: \ / : * ? " < > | # { } % & " ~ +

You cannot start a site name, subsite name, or a site group name with an underscore (_) character or with the period character (I recommend avoiding the (_) underscore in site names)

You cannot use the period character consecutively in the middle of a site name

You cannot use the period character at the end of a site name


File Names

Invalid characters: " # % & * : < > ? \ / { | } ~ 

Cannot be longer than 128 characters

You cannot use the period character consecutively in the middle of a file name

You cannot use the period character at the end of a file name

You cannot start a file name with the period character


Folder Names

You cannot use the following characters anywhere in a folder name or a server name: ~ # % & * { } \ : < > ? / | "

Cannot be longer than 128 characters

You cannot use the period character consecutively in the middle of a folder name

You cannot use the period character at the end of a folder name

You cannot start a folder name with the period character

Friday, August 31, 2007

Good WSS FAQ

For an excellent WSS resource pay a quick visit to http://wss.collutions.com/.

This one covers it all...
Introduction I
General II
Installation III
Administration IV
Basic Customization V
Interaction with Office VI
Tutorials VII
Documents and Web Sites
Articles
WSS v3 FAQ
STS (v1.0) FAQ

Sunday, July 29, 2007

Theme Customization

For a fantastic to the point tutorial on creating custom themes check out this MSDN link;

http://msdn2.microsoft.com/en-us/library/aa979310.aspx

Also, for the no bones UI FAQ, Heather Solomon is the place to go.

http://www.heathersolomon.com/blog/category/8.aspx

Monday, June 11, 2007

Excellent Developer Resource

If you don't mind the large poster sized charts, these free offerings from MindSharp are fantastic dev references.

https://www.mindsharp.com/Default.aspx?page=Login&destPage=RoadmapRequest