Skip to content
natem345 edited this page Apr 18, 2012 · 19 revisions

Change the Web.config file to match your paths. Descriptive comments are in the Models/AppConfiguration.cs code file.

Must have share on VMware host server allowing full access to VM files from the ASP.NET web server. Entering credentials for this share is not supported, so you must either a) make it public & anonymous b) give the webserver's account permission to access it c) make it a mapped network drive (but seems unsupported by IIS).

Must install the VMware VIX API from VMware on the Web server. http://communities.vmware.com/community/vmtn/developer/forums/automationapi

Deploy the app to IIS as you normally would. Sample directions:

  1. Copy the files to the C:\inetpub\wwwroot folder.

  2. In IIS, expand default web site. If VMat folder doesn’t appear, right-click an empty space in the section and click refresh.

  3. Right-click the folder and select “Convert to application.”

  4. Ensure .NET Framework 4.0 is targeted in the application pool.

In IIS, select the application pool that the program is running under, click on “Advanced Settings…” in the right hand panel. Find “Enable 32-bit Applications” and set the value to True. Also, note that the user the app pool runs under must be able to access the aforementioned share, which we found it can't by default with any of the default IIS users. To test, we just ran the app pool as an admin account. TODO.

Go to http://[server]/VMAT. You can run the /Configuration/Check page to check the Web.config settings.

After first running the app, at some point please power on any shutdown VMs so that their IP address can be recorded. They will default to 0.0.0.0 or NULL if powered off, but that will be updated once the app sees them on. If their IPs are not recorded by the app, duplicate IPs could be created.

Scheduled Tasks:

Certain tasks (Creation, Archive, and Backup) are scheduled. Our Quartz.NET scheduler works within the IIS process, such that if that should be restarted (by some error or automatically every 29 hours by default), a Web request must be made of the app in order to restart the app and reschedule the tasks. Otherwise, the scheduled tasks may be missed.

Note that there are workarounds that can be applied to increase the reliability of scheduled tasks:

  1. Disable automatic app pool recycling every 29 hours: In IIS Manager, select the application pool, and select Recycling under Edit on the right. Uncheck recycle every x minutes and apply.

  2. Disable idle timeout (set to 0): in IIS manager, select app pool, click Advanced Settings, and set Idle time-out (under Process Model) to 0.

  3. Auto-Start, if using IIS 7.5 To use the ASP.NET 4 auto-start feature, you first configure the IIS “application pool” worker process that the application runs within to automatically startup when the web-server first loads. You can do this by opening up the IIS 7.5 applicationHost.config file (C:\Windows\System32\inetsrv\config\applicationHost.config) and by adding a startMode=”AlwaysRunning” attribute to the appropriate entry:

<applicationPools> <add name="MyAppWorkerProcess" managedRuntimeVersion="v4.0" startMode="AlwaysRunning" /> </applicationPools>

In the future, a more reliable method of running the scheduler may be used, such as Windows Task Scheduler or a separate service.

Domain Accounts:

Enabling domain accounts is just a matter of IIS configuration. Ensure the Web server is a member of the desired domain. Ensure that Windows Authentication is enabled under IIS Authentication. Ensure that the appropriate group (such as Users) has permission to access the wwwroot folder (you can use Edit Permissions in IIS Manager). Finally, when users log into the application, they might need to use the form <username>.

Troubleshooting:

No start page, or shows a directory listing

This error is caused by .NET not being registered in IIS properly, use Aspnet_regiis.exe to fix. ie: %windir%\Microsoft.NET\Framework\v4.0.30319\Aspnet_regiis.exe -i

I then got a 401.2 not authorized message

Either log in (perhaps with domain accounts, per above instructions), or change our Web.config from denying unauthorized users to allowing all users (under authorization).

No images show up.

First, enable file browsing. In IIS, click on the default web site. In the middle pane, double-click Directory Browsing. On the right hand side, there should be some options, including "Enable"; click that.

Next, right-click a place on the web site where an image should appear, and click "Open image in new tab". If it shows up, try refreshing the page; if you get an unauthorized error, go to the directory that has the VMAT folder in it. Right click the Images folder, go to the security tab, edit. Add "Everyone" and give it read priveledges and OK out of that dialog. Repeat for the Scripts and Styles folders. It should now work.

Clone this wiki locally