August 17

Virtualization: Virtualbox command line options and control

Controlling the VirtualBox VM

Now that we have VirtualBox installed and a VM guest created we need to control and modify the VM

How to List VM information

How to show the VirtualBox VM info

vmadmin$ VBoxManage showvminfo <vmname>

How to show the VM Harddrive info

vmadmin$ VBoxManage showhdinfo <filename>

How to list running VM

vmadmin$ VBoxManage list runningvms

How to list available VM

vmadmin$ VBoxManage list vms

How to list available VM Harddrives

vmadmin$ VBoxManage list hdds

How to list available ISO’s

vmadmin$ VBoxManage list dvds

How to Control VM

How to Start VM

nohup and & to place process in background, so VM continues to run after closing console.

vmadmin$ nohup VBoxHeadless –startvm <vmname> &

How to pause VM

vmadmin$ VBoxManage controlvm <vmname> pause

How to resume VM

vmadmin$ VBoxManage controlvm <vmname> resume

How to reset VM

vmadmin$ VBoxManage controlvm <vmname> reset

How to poweroff VM (hard poweroff eg. pull the plug)

vmadmin$ VBoxManage controlvm <vmname> poweroff

How to poweroff VM (Save State)

vmadmin$ VBoxManage controlvm <vmname> savestate

How to send poweroff single to VM (tells VM OS to shutdown)

vmadmin$ VBoxManage controlvm <vmname> acpipowerbutton

* Be certain to set your power options inside of your guest OS to respond to the power button.

How to attach a DVD / CD to a running vm

vmadmin$ VBoxManage controlvm <vmname> dvdattach <filename>

How to de-attach a DVD / CD from a running vm

vmadmin$ VBoxManage controlvm <vmname> dvdattach none

By: Fabio Milano, additions by Tim Conrad

Category: Virtualization | Comments Off on Virtualization: Virtualbox command line options and control
August 13

DS3200: Storage Manager commands

When in the IBM DS Storage Manager Enterprise management client you can run scripts to check the status and execute commands on the DS series storage systems.

1. Login
2. Go to Tools – Execute scripts
3. Type in your command in the upper script editor window
4. Click Tools – Execute Only

Command Examples:

Command to check status on the DS3200 – show logicalDrive [“drivenumber”] actionProgress;
eg. show logicalDrive [“5”] actionProgress;
Command to force a drive replacement on the DS3200 – replace Drive [chassis number, slot] replacementDrive=chassis number,slot;
eg. replace Drive [82,2] replacementDrive=85,2;

Category: Virtualization | Comments Off on DS3200: Storage Manager commands
August 6

VMWARE: Increase the capacity of a VMFS datastore

After increasing the Lun on a SAN a simple rescan will not work within Virtual Center.  The process to make the new extended size show up in Virtual Center starts by logging directly into a ESX host that connects to the LUN.
To increase the capacity of a VMFS datastore:
   1. In vCenter Server, select the Datastores view.
   2. Select the datastore you want to grow and identify the host that has more virtual machines running on it.
   3. Open another vSphere client that connects directly to the ESX host.
   4. Go to Configuration > Storage adapters and perform a rescan. For more information, see Performing a rescan of the storage on an ESX/ESXi host (1003988).
   5. Go to Configuration > Storage, click the datastore that you want to grow, and click Properties.
   6. Ensure that the new size of the device is listed in the Extent Device list. If the increased size is not reflected, review the changes on the storage array and rescan again.
   7. Click Increase.
   8. Select a device from the list of storage devices for which the Expandable column is Yes and click Next.
   9. Set the capacity for the extent. The default capacity for the extent is the entire free space on the storage device. VMware recommends you to use the default setting.
   10. Click Next.
   11. After the process completes, go to vCenter Server, right-click the cluster that sees the expanded datastore, and click Rescan for Datastores. For more information, see Performing a rescan of the storage on an ESX/ESXi host (1003988).
   12. If there are other hosts that see the expanded datastore, perform a rescan on these hosts also.

Note: If the LUN experiences a high I/O throughput when growing the VMFS, the ESX host may not be able to complete the operation. In such a case, repeat the process during non-business hours and when backup operations are not running. If the problem persists, power off some of the virtual machines residing on the LUN and then retry.

By: VMWARE
Category: Virtualization | Comments Off on VMWARE: Increase the capacity of a VMFS datastore
March 19

VMWARE: Recommended disk or LUN sizes for VMware ESX 3.x / 4.x and ESXi 3.x / 4.x / 5.x installations

Recommended disk or LUN sizes for VMware ESX 3.x / 4.x and ESXi 3.x / 4.x / 5.x installations (1026500)

Details

This article provides information on:

  • Required default storage space for a VMware ESX or ESXi installation.
  • LUN size for a boot-from-SAN configuration.

Solution

VMware recommends provisioning enough space to satisfy the partitioning requirements outlined in product documentation. The default partitioning layout is sufficient for the majority of deployments, but the information provided here may be used as a baseline for customization.

Notes:

  • These space requirements outlined are based on the partition tables created by the graphical and text-based installers.
  • Boot-from-SAN configurations require additional consideration with regards to VMFS. For VMware ESX 4.0 and 4.1, which require VMFS, you may format a portion of the boot LUN as VMFS (default), or opt for utilization of a separate storage device formatted as VMFS to store the Console OS.

VMware ESX 3.0.3 and 3.5

VMware ESX 3.x requires a minimum of approximately 8 GB.

System Disk Partitions

  • 100 MB boot partition
  • 5 GB system root partition
  • VMFS partition, if defined, spans the remainder of the disk
  • Extended partition

System Disk Logical Partitions

  • 1 GB swap partition
  • 2 GB system log partition
  • 110 MB VMkernel core dump partition

VMware ESX 4.0 and 4.1

For VMware ESX 4.x, the ESX Console OS is instead situated within a virtual machine disk (.vmdk) file on a VMFS file system. The size of this disk file varies between deployments, based on the size of the logical unit used. A minimum requirement is approximately 8 GB.

Notes:

  • The stored Console OS virtual machine disk files may increase in size over the course of a deployment, accommodating for additional log data and files.
  • It can be stored on a SAN LUN or different block device than the system disk, as long as it has been partitioned and formatted as VMFS.
  • The Console OS disk, as a best practice, should not be situated on a shared SAN LUN.

System Disk Partitions

  • 1100 MB boot partition
  • 110 MB VMkernel core dump partition
  • Extended partition spans the remainder of the disk
  • Logical VMFS partition spanning the remainder of the extended partition

VMFS Partition / Console OS VMDK Partitions

These are partitions that reside within the Console OS VMDK, stored on the formatted VMFS volume:
  • 600 MB swap partition
  • 2 GB system log partition
  • Extended partition spanning remainder of Console OS .vmdk file
  • 5 GB system (root) partition

VMware ESXi 3.5, 4.0, and 4.1 (Installable)

VMware ESXi installations benefit from reduced space and memory requirements due to the omission of the Console OS. It requires approximately 6 GB of space without a defined VMFS partition or datastore.

When additional block devices are provided, they may be formatted and utilized as VMFS, or in some cases as additional scratch storage space.

System Disk Partitions

  • 4.2 MB FAT boot partition
  • Extended partition
  • 4.3 GB FAT partition for scratch storage and swap
  • Remainder of device may be formatted as VMFSNote: The minimum size for a VMFS datastore is approximately 1 GB.

System Disk Logical Partitions

  • 250 MB FAT partition for a hypervisor bootbank
  • 250 MB FAT partition for a second hypervisor bootbank
  • 110 MB diagnostic partition for VMkernel core dumps
  • 286 MB FAT partition for the store partition (VMware Tools, VMware vSphere/Infrastructure Client, core)

VMware ESXi 3.5, 4.0, and 4.1 (Embedded / USB)

Embedded VMware ESXi installations typically utilize approximately 1 GB of non-volatile flash media via USB. An additional 4-5 GB of space may be defined on local storage for additional scratch storage and swap to be stored.

Persistent logging is not included with embedded ESXi. VMware recommends configuring remote syslog services for troubleshooting or when anticipating technical issues. For more information, see Enabling syslog on ESXi (1016621).

USB Device Primary Partitions

  • 4.2 MB FAT boot partition
  • Extended partition

USB Device Logical Partitions

  • 250 MB FAT partition for a hypervisor bootbank
  • 250 MB FAT partition for a second hypervisor bootbank
  • 110 MB diagnostic partition for VMkernel core dumps
  • 286 MB FAT partition for the store partition (VMware Tools, VMware vSphere/Infrastructure Client, core).

Local Disk Partitions (If Present)

  • 4.3 GB FAT partition for scratch storage and swap
  • 110 MB diagnostic partition for VMkernel core dumps
  • Remainder of device may be formatted as VMFSNote: The minimum size for a VMFS datastore is approximately 1 GB.
For more information on these installation requirements, see the respective installation guide for your selected product in the VMware Documentation pages.

VMware ESXi 5.0 (Installable)

For fresh installations, several new partitions are created for the boot banks, the scratch partition, and the locker.
Fresh ESXi installations use GUID Partition Tables (GPT) instead of MSDOS-based partitioning. The partition table itself is fixed as part of the binary image, and is written to the disk at the time the system is installed. The ESXi installer leaves the scratch and VMFS partitions blank and ESXi creates them when the host is rebooted for the first time  after installation or upgrade.

One 4 GB VFAT scratch partition is created for system swap. Fore more information, see About the Scratch Partition section in the vSphere Installation and Setup Guide.

The VFAT scratch partition is created only on the disk from which the ESXi host is booting.
During ESXi installation, the installer creates a 110 MB diagnostic partition for core dumps. The other size recommendations that apply to ESXi 4.x installable are also applicable to ESXi 5.0 installable.

VMware ESXi 5.0 (Embedded/USB)

One 110 MB diagnostic partition for core dumps, if this partition is not present on another disk. The other size recommendations that apply to ESXi 4.x embedded are also applicable to ESXi 5.0 embedded.

The VFAT scratch and diagnostic partitions are created only on the disk from which the ESXi host is booting. On other disks, the software creates one VMFS5 partition per blank disk, using the whole disk. Only blank disks are formatted.
In ESXi Embedded, all visible blank internal disks with VMFS are also formatted by default.
vSphere 5.0 supports booting ESXi hosts from the Unified Extensible Firmware Interface (UEFI). With UEFI you can boot systems from hard drives, CD-ROM drives, or USB media.
ESXi can boot from a disk larger than 2 TB provided that the system firmware and the firmware on any addin card that you are using support it. See the vendor documentation.
USB key size for ESXi 5.0 embedded is vendor dependent.

For more information on Install requirements for ESXi 5.0, see vSphere Installation and Setup Guide.

VMware ESXi 5.1

For information on ESXi 5.1, see the ESXi Hardware Requirements section in the vSphere Upgrade Guide.

Note: A diagnostic partition cannot be located on an iSCSI LUN accessed through the software iSCSI or dependent hardware iSCSI adapter. For more information, see Working with Datastores section section in the vSphere Storage Guide.
Category: Virtualization | Comments Off on VMWARE: Recommended disk or LUN sizes for VMware ESX 3.x / 4.x and ESXi 3.x / 4.x / 5.x installations
March 19

VMWARE: Using the partedUtil command line utility on ESXi and ESX

Using the partedUtil command line utility on ESXi and ESX (1036609)

Symptoms

If you specify an incorrect GUID size using the partedUtil command, you may see errors similar to:

  • error: “Invalid guid (0xfb). Contains non-hexadecimal digits
  • Invalid guid (fb). Length should be 32
  • Invalid guid (251). Length should be 32

Purpose

This article provides information on using the partedUtil command line disk-partitioning utility on ESXi and ESX.

Note: VMFS datastores can be created and deleted using the vSphere Client connected to an ESXi/ESX host or to vCenter Server. It is not necessary to manually create partitions using the command line utility. For more information, see the Managing Storage section of the Configuration Guide for your version of ESXi/ESX.

Resolution

You can use the partedUtil command line utility to directly manipulate partition tables for local and remote SAN disks on ESXi and ESX.

The partedUtil command line only is supported for disk partitioning from ESXi 5.x. The command line utility fdisk does not work with LUNs formatted with VMFS5.

Note: This article assumes that a console session is available to the ESXi or ESX host, that you are familiar with the console and disk management concepts, and that you have made adequate backups before proceeding. For more information, see:

  • Unable to connect to an ESX host using Secure Shell (SSH) (1003807) or
  • Using Tech Support Mode in ESXi 4.1 and ESXi 5.x (1017910).

    If you are unsure of performing any step, contact VMware Support.

For information on re-creating a missing VMFS partition table using PartedUtil see: Re-creating a missing VMFS datastore partition in vSphere 5 (2046610)

Retrieving a list of disk devices

Each partedUtil command accepts a device argument specifying a local or SAN-based disk to operate against. This should be a path name beginning with /vmfs/devices/disks/. It should specify the whole block device rather than an existing partition on the device.

To obtain a list of disk device names that can be managed by partedUtil, run this command:

ls /vmfs/devices/disks/

Example of output under ESXi/ESX 3.x:

vmhba0:0:0:0 <– disk device
vmhba0:0:0:1 <– partition 1
vmhba0:0:0:2 <– partition 2
vmhba0:0:0:3 <– partition 3
vmhba0:0:0:5 <– partition 5
vmhba3:0:0:0 <– disk device
vmhba3:0:0:1 <– partition 1

Example of output under ESXi/ESX 4.0 and later:

mpx.vmhba0:C0:T0:L0 <– disk device
mpx.vmhba0:C0:T0:L0:1 <– partition 1
mpx.vmhba0:C0:T0:L0:2 <– partition 2
mpx.vmhba0:C0:T0:L0:3 <– partition 3
mpx.vmhba0:C0:T0:L0:5 <– partition 5
naa.60060160205010004265efd36125df11 <– disk device
naa.60060160205010004265efd36125df11:1 <– partition 1

Note: When specifying a block device using the partedUtil command, use the full path and enclose it in double quotes.

For more information on identifying a specific disk device, see Identifying disks when working with VMware ESX (1014953).

Printing an existing partition table

An existing partition table on a block disk device may be examined using the partedUtil command line utility. To obtain a list of partitions defined on a block disk device:

  • For ESXi/ESX 4.0 and earlier, use this command:

    partedUtil get “/vmfs/devices/disks/DeviceName

  • For ESXi/ESX 4.1 and later, use this command:

    partedUtil getptbl “/vmfs/devices/disks/DeviceName

    Example: To display the partition table for a device on an ESX 4.1 host:

    partedUtil getptbl “/vmfs/devices/disks/mpx.vmhba0:C0:T0:L0

Example output:

msdos
17834 255 63 286513152
1 63      2249099   131 128
2 2249100 2474009   252 0
3 2474010 286487144 5   0
5 2474073 286487144 251 0

The first line is only present in the getptbl form of the command, and displays the disk label identifying the partitioning scheme being used. Common labels are bsd, dvh, gpt, loop, mac, msdos, pc98, and sun. Of these, only the msdos label and gpt partitioning scheme is used by ESXi/ESX.

Note: The label msdos does not mean that the device contains a Windows file system or is being used by a Windows machine. It only means that it is a MBR (Master Boot Record) partition.

The second line displays the disk geometry information read from the underlying device:

17834 255 63 286513152
|     |   |  |
|     |   |  —– quantity of sectors
|     |   ——– quantity of sectors per track
|     ———— quantity of heads
—————— quantity of cylinders

The remaining lines identify each defined partition. If no partitions are defined, this list is blank. The list may not be sorted.

Example: Here there are 4 partitions defined. The first partition (type 131 = 0x83 = Linux) is bootable. The second partition is a VMKcore coredump partition datastore (type 252 = 0xFC). The third partition is an Extended partition (type 5) containing additional Logical partitions. The fourth partition (numbered 5), is a Logical partition within partition number 5 and contains a VMFS Datastore (type 251 = 0xFB).

1 63      2249099   131 128
2 2249100 2474009   252 0
3 2474010 286487144 5   0
5 2474073 286487144 251 0
| |       |         |   |
| |       |         |   — attribute
| |       |         ——- type
| |       —————– ending sector
| ————————- starting sector
————————— partition number

Properties of a partition:

  • The starting and ending sectors specify how much contiguous disk space a partition occupies. User-friendly sizes of partitions can be calculated from this information. For example, VMKCore partition 2 spans from sector 2249100 to 2474009, covering 224909 sectors of the disk. This disk has 512 bytes per sector, so this partition is 224909 x 512 = 115153408 bytes = 109 MB in size.
  • The partition type identifies the purpose of a partition, and may be represented by either a decimal identifier (for example, 251) or a GUID (for example, AA31E02A400F11DB9590000C2911D1B8). See the list of commonly used partitions in the Additional Information section.
  • The partition attribute is a number which identifies properties of the partition. A common attribute is 128 = 0x80, which indicates that the partition is bootable. Otherwise, most partitions have an attribute value of 0.

Creating a new partition table

A new partition table can be created on a block disk device using the partedUtil command line utility. To create a new partition on a block device, use a different command depending on the version of ESXi/ESX:

  • For ESXi/ESX 4.0 and earlier, use the command:

    partedUtil set “/vmfs/devices/disks/DeviceName” [“partNum startSector endSector type/guid attribute“]*

  • For ESXi/ESX 4.1 and later, use the command:

    partedUtil setptbl “/vmfs/devices/disks/DeviceName” DiskLabel [“partNum startSector endSector type/guid attribute“]*

The disk label is only specified in the setptbl form of the command, and sets the disk label identifying the partitioning scheme being used. Common labels are bsd, dvh, gpt, loop, mac, msdos, pc98, and sun. ESXi 5.x and higher supports both the msdos and gpt label and partitioning schemes, while ESXi/ESX 4.1 and earlier supports the msdos label and partitioning scheme exclusively.

The list of partitions to apply to the disk must be fully specified on the partedUtil command line. To add additional partitions to a disk with an existing partition, specify both the original and new partitions on the command line. If you do not, the existing partition is lost. The list of partitions are specified as quoted strings, each of which encapsulates a 5-tuple composed of the partition number, starting sector, ending sector, type ID, and attributes:

  • The startSector and endSector specify how much contiguous disk space a partition occupies. The starting sector is enforced to be before the ending sector for the same partition, but no guarantee is made that the partition defined does not overlap another partition.
  • The partition type identifies the purpose of a partition, and may be represented by either a a decimal identifier (for example, 251) or a GUID (for example, AA31E02A400F11DB9590000C2911D1B8). See the list of commonly used partitions in the Additional Information section. Partitions created on ESXi 5.x and higher with the gpt disklabel must be specified using the GUID.
  • The partition attribute is a number which identifies properties of the partition. A common attribute is 128 = 0x80, which indicates that the partition is bootable. Otherwise, most partitions have an attribute value of 0.

Example: To create two consecutive ~244 MB partitions of type 131 = 0x83, the first of which is bootable and starts at offset 128:

  • For ESXi/ESX 4.0 and earlier, use this command:

    partedUtil set “/vmfs/devices/disks/mpx.vmhba0:C0:T0:L0” “1 128 500000 131 128” “2 500001 999999 131 0”

  • For ESXi/ESX 4.1 and later on an msdos label, use this command:

    partedUtil set “/vmfs/devices/disks/mpx.vmhba0:C0:T0:L0” msdos “1 128 500000 251 0”

  • On ESXi 5.x and later on a gpt label, use this command:

    partedUtil setptbl “/vmfs/devices/disks/mpx.vmhba0:C0:T0:L0” gpt “1 128 500000 AA31E02A400F11DB9590000C2911D1B8 128” “2 500001 999999 AA31E02A400F11DB9590000C2911D1B8 0”

    Note: Volumes that are upgraded from VMFS-3 to VMFS-5 continue to have the VMFS partition starting at sector 128, rather than at sector 2048.

Caution: There is no facility to undo a partition table change other than creating a new partition table. Ensure that you have a backup before marking any change. Ensure that there is no active I/O to a partition prior to modifying it.

Sizing of partitions is outside the scope of this article. For more information, see Recommended disk or LUN sizes for VMware ESXi/ESX installations (1026500).

Deleting a partition

A single partition can be deleted from a partition table on a block disk device using the partedUtil command line utility.

To delete a partition, use this command:

partedUtil delete “/vmfs/devices/disks/DeviceNamePartitionNumber

Example:

partedUtil delete “/vmfs/devices/disks/mpx.vmhba0:C0:T0:L0” 2

Caution: There is no facility to undo a partition table change other than creating a new partition table. Ensure that you have a backup before making any change. Ensure that there is no active I/O to a partition before modifying it.

Resizing a partition

The partedUtil command can be used to resize an existing partition on ESXi/ESX 4.0 and higher. This does not resize the file system within the partition, and is no different from deleting and recreating the partition with a new starting or ending sector.

To resize a partition, use this command:

partedUtil resize “/vmfs/devices/disks/DeviceNamePartitionNumber NewStartSector NewEndSector

Example: To move partition 4 such that it starts in the same location (for example, 2474073) and ends at the new ending sector (1234567890), run this command:

partedUtil resize “/vmfs/devices/disks/mpx.vmhba0:C0:T0:L0” 4 2474073 1234567890

Caution: There is no facility to undo a partition table change other than creating a new partition table. Ensure that you have a backup before making any change. Ensure that there is no active I/O to a partition before modifying it.

Additional Information

The partition type identifies the purpose of a partition, and may indicate intended usage by a particular operating system. Partition types must be specified by the GUID only in the partition table (when using the partedUtil setptbl command).

You can obtain the GUID using the command:

partedUtil showGuids

Partition types commonly used by ESXi/ESX include:

Partition GUID Type (Hex) Type (Decimal)
VMFS Datastore AA31E02A400F11DB9590000C2911D1B8 0xFB 251
VMKCore Diagnostic 9D27538040AD11DBBF97000C2911D1B8 0xFC 252
VMware Reserved 9198EFFC31C011DB8F78000C2911D1B8
Basic Data EBD0A0A2B9E5443387C068B6B72699C7 0x83 131
Linux Swap 0657FD6DA4AB43C484E50933C84B4F4F 0x82 130
Linux LVM E6D6D379F50744C2A23C238F2A3DF928 0x8E 142
Linux RAID A19D880F05FC4D3BA006743F0F84911E 0xFD 253
EFi System C12A7328F81F11D2BA4B00A0C93EC93B 0xEF 239
Microsoft Reserved E3C9E3160B5C4DB8817DF92DF00215AE
Unused Entry 00000000000000000000000000000000
Fat16 0x6 6
Extended 0x5 5
SFS 0x42 66
NTFS 0x7 7
Category: Virtualization | Comments Off on VMWARE: Using the partedUtil command line utility on ESXi and ESX