Archive for category Scripts

Automatically start a vApp on XenServer boot

Yesterday I was made aware of a new blogpost by @MichelHelderman on Twitter by my colleague @KBaggerman who refered Michel to a blogpost I wrote on enabling the VM autostart through the CLI for XenServer 6.0.
This feature is no longer available through the XenCenter GUI in XenSeerver 6.0 as it was interfering with the HA features on XenServer.

Michel provides you with a great alternative, namely the introduction of the new vApp feature for XenServer 6.0, which allows you to group VMs on a XenServer and control the automatic startup of the entire VM group. Even allowing you to set the boot order and wait time between boots.

The only setback with using the new vApp feature to group you VMs is that the vApp itself cannot be configured to automatically start when a physical XenServer Host is booted. It still requires a manual action through the GUI or CLI to start the vApp and have all VMs booted in their set order. Something we most definately want to be automated.
As there is no attribute for the vApp to configure it to auto-start, like my previous post explains for individual VMs, there are alternative ways to have a vApp be automatically started when a XenServer Host boots.

In this blogpost I have gathered some of the alternative methods to implement the auto-start feature for your VMs as I have found them on the internet.

Read the rest of this entry »

Tags:

XenServer PowerShell 101

Over two years ago I discovered PowerShell as a very usefull scripting language to support the fully automated install and config of a Windows 2008 Office Automation domain with XenApp and RES Software products. Thanks to RES Automation Manager (back than it was still called Wisdom) I could easily build PowerShell scripts to create the required Active Directory structure, Exchange environment and use small scripts for different configurational settings. RES Automation Manager ensured I only needed to concentrate on the actual scripts, as I could configure the Tasks options to ensure the correct execution rights were used and the required snap-ins were loaded by specifying the use of a PowerShell configuration file (.psc1).

 

This blog is all about reconnecting with PowerShell as I want to explore the PowerShell SnapIn for XenServer 6.0.
A quick overview of the available commands is provided with a great poster from Björn Andersson (diversetips.se) for XenServer 6.0:

This blog will be all about the basic PowerShell commands to setup my scripting environment and slowly build up to more complex scripts for XenServer management.

Read the rest of this entry »

Tags: ,

Automatically build a Windows 2008 Stand-alone Domain

The last nine months at work have been spent on a project to create a fully automatic installation of a stand-alone Windows Servers infrastructure. Nothing fancy, just the basic Serverroles one might need in a stand-alone Domain.

I had alot of fun transforming all the needed commandlines, scripts and settings into RES Wisdom Modules and Tasks. So after that experience I’ve decided to recreate a new installation set for my own HomeLab. So alot of new posts will be describing the automation of Server Role and software installations and configurations.

I’ve found myself a new Quest!

diskpart.exe CommandLine Interface

The easiest way to connect to you iSCSI storage LUNs from Windows Server 2008 is by using the iSCSI initiator GUI. With the GUI you can easily make a connection with your iSCSI Storage by giving the ip-address and dynamically discover the LUNs (or Volumes) it has to offer.

As I’m working on scripts to automate the installation and configuration of Windows Server 2008 systems, I was also looking for a way to configure the local disks and volumes of a Server, without having to use the GUI and manual instructions. Luckily Windows offers some nice tools for scripting. The scripting and configuration of the local disks and volumes can best be done with diskpart.exe. Which offers it’s own commandline interface and the option to use a preconfigured script with all the commands.

 

This post offers step-by-step instructions for the diskpart.exe command.

 

This article is updated with additional diskpart command information, provided by Olav Meijer.
The additions to the diskpart sample scripts are marked in red.
 

 
Read the rest of this entry »

Tags: , ,

Windows Server 2008 iscsicli.exe CommandLine Interface

The easiest way to connect to you iSCSI storage LUNs from Windows Server 2008 is by using the iSCSI initiator GUI. With the GUI you can easily make a connection with your iSCSI Storage by giving the ip-address and dynamically discover the LUNs (or Volumes) it has to offer. With the Windows Server 2008 R2 Core edition, you can start the GUI with iSCSICPL.exe.
In case you do not have the option to use the GUI (Core Server or when scripting the configuration), you can use the CommandLine Interface (CLI) Windows Server 2008 has to offer by default.

The iscsicli.exe command of Windows Server 2008 allows you to use the Microsoft iSCSI initiator without the GUI. Making it the perfect tool for scripting the iSCSI connections (Hyper-V Server shared storage). If you know the ip-address of your iSCSI storage and the IQN of the LUN you want to use (though it can be found with the command), you are all set to set up the connection and use your shared storage.

 

This post offers step-by-step instructions for the iscsicli.exe command.

 
Read the rest of this entry »

Tags: , ,