Virtual Machines: Difference between revisions
(→Increase Disk Size: Added link to "Can't Increase a VM's Disk") |
(Added "File Information") |
||
Line 90: | Line 90: | ||
# Set the "Default risk level for file types" to Enabled | # Set the "Default risk level for file types" to Enabled | ||
# Specify the low extensions as <code> .bat;.exe </code> | # Specify the low extensions as <code> .bat;.exe </code> | ||
== Files Information == | |||
{|cellpadding="4" cellspacing="0" border="1" | |||
|- style="background-color:#bbddff;" | |||
! File !! Purpose !! Notes | |||
|- | |||
| <code> *.vmx </code> || VM config file || Contains the full config of the virtual machine | |||
|- | |||
| <code> *.vmsd </code> || || | |||
|- | |||
| <code> *.vmxf </code> || || | |||
|- | |||
| <code> *.vmdk </code> || Virtual hard-drive file || | |||
|- | |||
| <code> *.nvram </code> || vBIOS file || Can be deleted, gets recreated on VM start (BIOS settings will be defaulted) | |||
|- | |||
| <code> *.vswp </code> || VM memory swap file || Can be deleted(?) | |||
} | |||
== Increase Disk Size == | == Increase Disk Size == |
Revision as of 12:22, 30 September 2010
Basic Virtual Machine Tasks
Start / Stop / Bounce a VM
- Log into the Virtual Infrastructure - Management Access
- Under the Inventory button, ensure Hosts and Clusters is ticked
- Highlight the VM you want to affect
- Either right-click or use the commands in the right hand pane to Power off, Power on, Reset as required
This is the same as using the Power or Reset buttons on the front of a physical server. It's possible to send Windows shut down etc commands to the VM; right click over the VM and select the appropriate Shut Down Guest, Restart Guest command. This tells VM Tools to attempt to perform the required action, obviously open applications etc can inhibit the successful shutdown of an OS.
Remote Console (KVM like) Access
If possible, its preferable to use normal remote access software (eg RDP, or VNC). This ensures that load caused by remote access is contained within the VM, rather than the ESX.
- Log into the Virtual Infrastructure - Management Access
- Under the Inventory button, ensure Hosts and Clusters is ticked
- Highlight the VM you want and either right click Open Console or use the Open Console command in the right hand pane
CD-ROM Access
There are essentially two ways to present a CD-ROM image to a VM, using an ISO image is by far and away the most flexible. Even if you only have a physical CD and expect to use it once, its still recommended that you create an ISO image from the CD and use that instead. The alternative is to put the physical media into the ESX hosting the VM (use Host Device when adding the CD to the VM).
To present an ISO image to a VM
- If its not already there, copy the ISO image to an NFS share or other ESX accessible datastore
- Log into the Virtual Infrastructure - Management Access
- Under the Inventory button, ensure Hosts and Clusters is ticked
- Highlight the VM you want to attach the ISO image to
- Right-click and select Edit Settings...
- Highlight the CD/DVD Drive, and select the Datastore ISO file
- Hit Browse and go into the appropriate datastore
- Select the required ISO file
- Tick the Connected check box
- Hit OK, the ISO will be attached to the VM's CDROM drive as if you'd inserted a CD into a physical drive
- Once you've finished using the ISO, go back into the VM's settings and untick the Connected check box
- To boot a VM to a CDROM ISO, check the "Connected at power on" checkbox and restart the VM's OS
To create an ISO image
You'll need to download an ISO creator, there are many freeware utilities available, however one that's tried and tested is ISORecorder. Generally you can create ISO images from both a physical CD, or just the contents of a folder (if you have ISORecorder installed, right-click over the disk or folder and select "Create ISO image")
Change Network Connection
In similar fashion to being able to swap over a network cable for a physical server, the network connection of a virtual machine can be changed on the fly
- Log into the Virtual Infrastructure - Management Access
- Under the Inventory button, ensure Hosts and Clusters is ticked
- Highlight the VM you want to change the network connection on
- Right-click and select Edit Settings...
- Hightlight the appropriate Network Adapter, and select the new Network Connection
- Change takes effect as soon as OK is hit
Add an Additional Network Connection
When adding additional network connections to any system you must consider network security, for example no system should ever be given access to both Private and Public networks.
- Shut down the Application and OS of the virtual machine
- Log into the Virtual Infrastructure - Management Access
- Under the Inventory button, ensure Hosts and Clusters is ticked
- Highlight the VM you want to add the network connection to
- Right-click and select Edit Settings...
- Hit the Add... button and select Ethernet Adapter, and hit Next
- Select the appropriate network connection and hit Next, and then Finish
- Power on the virtual machine
Change Physical Memory / CPU's Allocation
- Shut down the Application and OS of the virtual machine
- Log into the Virtual Infrastructure - Management Access
- Under the Inventory button, ensure Hosts and Clusters is ticked
- Highlight the VM you want to change the network connection on
- Right-click and select Edit Settings...
- Hightlight the appropriate setting, Memory or CPUs, and edit as required.
- Apply the change by hitting OK
- Power on the virtual machine
Config Settings
Disable Shutdown Event Tracker
If the ESX servers are running as a HA cluster then they MUST be able to fully startup automatically after a re-boot. The Windows OS Shutdown tracker asks why you're shutting down or rebooting a system, or following an unexpected shutdown, halts the starting of a system pending information from the user. Not a problem for servers where all applications run as a service, but would impede VMware HA operating effectively where (GUI) applications need to start by stopping systems being restarted fully.
To disable...
- Start Group Policy Object Editor (Start | Run | gpedit.msc)
- Go to Computer Configuration\Administrative Templates\System
- Set Display Shutdown Event Tracker to Disabled
Set Low Risk File Types
If mapped drives are being used, .bat and .exe files need to be declared as low risk file types to stop Open file - Security Warning prompts being displayed when trying to run from mapped drives. This is particularly a problem if software is set to auto-start by placing shortcuts in the StartUp directory, as the software won't auto start.
To disable...
- Start Group Policy Object Editor (Start | Run | gpedit.msc)
- Go to User Configuration\Administrative Templates\Windows Components\Attachment Manager
- Set the "Default risk level for file types" to Enabled
- Specify the low extensions as
.bat;.exe
Files Information
File | Purpose | Notes | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
*.vmx |
VM config file | Contains the full config of the virtual machine | ||||||||||||
*.vmsd |
||||||||||||||
*.vmxf |
||||||||||||||
*.vmdk |
Virtual hard-drive file | |||||||||||||
*.nvram |
vBIOS file | Can be deleted, gets recreated on VM start (BIOS settings will be defaulted) | ||||||||||||
*.vswp |
VM memory swap file | Can be deleted(?)
} Increase Disk SizeIncreasing the virtual disk size provided to a VM is straight forward (though be aware that snapshots need to be deleted 1st, if any exist)...
The trick is to extend the logical partition within the OS. Depending on the original partition type and the OS, the options vary. In-case of problems, see - Can't Increase a VM's Disk Increase Logical PartitionGenerally boot or system disks cannot be extended whilst the OS is up, whereas normal data disk can be in later OS's, but this is still not ideal. Its generally most reliable to plan for system down time, and use a utility to extend the partition whilst its offline. Especially in a virtual environment there is no excuse for not making a backup of the partition 1st. For Windows 2008 machines this isn't a problem. For Windows 2003 machines...
Download a copy of the GParted Live CD - http://gparted.sourceforge.net/livecd.php, this will need to be booted to by the VM
VM's With Lots Of DisksIt can be very difficult to identify the correct disk within VMware to increase when a VM has a large number of VMDK's.
Rename a VMRenaming a virtual machine just by right-clicking over the machine and renaming does not alter the underlying file and folder names. To ensure that these changes take place you must move the VM to another datastore, ie
If you can't move the VM to another datastore then it gets much more complicated, requiring faffing around in the service console.
The above was taxed from http://www.yellow-bricks.com/2008/02/10/howto-rename-a-vm/ Clone a VMThis can done as
Snapshots and CloningSnapshots are deleted during a clone, in that cloning a machine that has existing snapshots results in the post-snapshot changes being merged into the new machine. In order to retain the snaphosts, the virtual machine needs to be cloned manually (untested procedure!!)...
Shutdown VM via Service Console
Upgrade ESX3 to ESX4Preparation
ProcedureProcedure assumes your migrating machines from a VI3 infrastructure to a new VI4/vSphere infrastructure.
TroubleshootingSee also Virtual Centre Troubleshooting Can't Connect to VM ConsoleError connecting: Cannot connect to host...
Can't Deploy VMThe VirtualCenter server is unable to decrypt passwords stored in the customization specification
A general system error occurred: Failed to create journal file provider
Can't Start VMHA Admission Control
Failed to relocate virtual machine
Access to VMFS storage
VMFS full
ESX licensing
Waiting for question to be answered
Could not power on VM: No swap file. Failed to power on VM
Can't VMotion a VMVM network doesn't exist at destination
ESX / network too busy
ESXs can't communicate
VM is connect to CD-ROM/ISO
Can't Increase a VM's DiskA general system error occurred: Internal error
Can't SnapshotCannot create a quiesced snapshot because the create snapshot operation exceeded the time limit for holding off I/O in the frozen virtual machine
Can't Commit SnapshotIf snapshot files are large then patience is of the essence, and if possible, shut the VM down 1st, or at the very least limit activity on the VM. To commit a snapshot in a running VM, first a new snapshot is started, then the original redo files are merged with the base disk(s), then the extra redo file is merged. Operation timed-out
No Snapshots Exist in Snaphot Manager (but still exist)
Snapshot Still Active?
Can't CustomiseWindows setup could not configure Windows to run on this computer's hardware
|