Virtualization with Microsoft Virtual Server 2005

Appendix C: Windows Script Files for Virtual Server 2005 R2

Code Listings for Virtual Server 2005 R2

In this appendix, we include two examples of scripts that advanced users of Virtual Server 2005 R2 can use. Code Listing C.1 is an example of script for running a diagnostic query on Virtual 2005 Server R2. Code Listing C.2 is an example of script for creating disks and performing various operations on them.

Syngress

Code Listing C.1: Running a Diagnostic Query on Virtual Server 2005 R2
Virtual  Disk  ToolVDisk,  version  1.0,  2006Matthijs  ten  SeldamVDisk,  version  1.0,  2006Matthijs  ten  Seldam-------------------------------------------------------------------This  script  enables  operations  related  to  virtual  disks.  It  has  several  switches  to  create  all  types  of  virtual  disksand  to  perform  all  possible  operations  on  the  disks.See  the  options  explanation  under  usage.-------------------------------------------------------------------ExplanationImage      :  The  full  path  to  the  virtual  hard  disk  image  file.NewImage:  The  new  virtual  hard  disk  image  file  to  create.                    Only  valid  with  Create,  Convert,  MergeTo<a name="1058"></a><a name="IDX-383"></a>Parent    :  The  full  path  to  the  parent  virtual  hard  disk  file.                    Only  valid  with  Create  and  vhdType:DAction    :  This    n  be  one  of  the  following:                    Compact,  Convert,  Create,  Inspect,  Merge,  MergeTovhdType  :  Type  of  virtual  hard  disk  to  create.                      n  be  0:Expanding,  1:Fixed,  2:Differencing,  3:Floppy720,  5:Floppy144                    Only  valid  with  Create,  MergeToSize        :  Size  of  virtual  hard  disk  in  MB.Examples:vdisk  /image:c:\ virtualmachines\ disk1  /action:inspect      -->  Inspects  virtual  disk  and  lists  properties.vdisk  /image:c:\ virtualmachines\ disk1  /action:compact      -->  Compacts  Dynami  lly  expanding  virtual  disk.vdisk  /image:c:\ virtualmachines\ disk1  /action:merge      -->  Merges  Differencing  virtual  disk  with  its  parent.vdisk  /newimage:c:\ virtualmachines\ newfloppy  /vhdType:3  /action:create      -->  Creates  a  new  floppy  disk  of  size  720  KB.vdisk  /newimage:c:\ virtualmachines\ newfloppy  /vhdType:3  /action:create      -->  Creates  a  new  floppy  disk  of  size  1.44  MB.vdisk  /newimage:c:\ virtualmachines\ newdisk1  /size:500  /vhdType:0  /action:create      -->  Creates  a  new  virtual  hard  disk  of  size  500  MB  and  type  Dynami  lly  Expandingvdisk  /newimage:c:\ virtualmachines\ newdisk1  /size:500  /vhdType:1  /action:create      -->  Creates  a  new  virtual  hard  disk  of  size  500  MB  and  type  Fixed  Sizevdisk  /newimage:c:\ virtualmachines\ newdisk1  /parent:c:\ virtualmachines\ disk1  /vhdType:2  /action:create      -->  Creates  a  new  virtual  hard  disk  of  type  Differencing-------------------------------------------------------------------<a name="1059"></a><a name="IDX-384"></a><a name="1068"></a><a name="IDX-393"></a>
Code Listing C.2: Script for Creating Virtual Disks and Running Various Operations on Them

Syngress

VSInfo  query  toolVSInfo,  version  1.0,  2006Matthijs  ten  SeldamVSInfo,  version  1.0,  2006Matthijs  ten  Seldam-------------------------------------------------------------------This  script  queries  the  lo  l  Virtual  Server  installation  for  info.It  has  several  switches  to  query  specific  parts  of  Virtual  Server.See  the  options  explanation  under  usage.-------------------------------------------------------------------Examples:cscript  vsinfo  /vs      -->  Gives  Virtual  Server  Configuration  info.cscript  vsinfo  /host  -->  Gives  Virtual  Server  Host  info.cscript  vsinfo  /sec    -->  Gives  Virtual  Server  Security  info.cscript  vsinfo  /hc      -->  Runs  Virtual  Server  Host  check.<a name="1070"></a><a name="IDX-394"></a>

UNLIMITED FREE
ACCESS
TO THE WORLD'S BEST IDEAS

SUBMIT
Already a GlobalSpec user? Log in.

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.

Customize Your GlobalSpec Experience

Category: Data Security Software
Finish!
Privacy Policy

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.