Tuesday, April 7, 2009

Can we attach Tape drive to the Virtual Machine ?

I had been askedweird question “Can I configure virtual machine with Tape drive connected to it and use it as my backup server?” Crap why you want to do that? Obvious answer we don’t have fund to buy hardware dedicated for backup. So here comes my googling and seems like you can have Tape drive configured to your virtual machine which can act as your backup server. It sounds funny but this is IT and you can expect question like this. How do I do it?There is very old article which holds good for ESX1.X but even same theory can be used for ESX3.X host.

Add the hardware as usual to the chassis. Once the hardware is physically added, log in to the ESX Server system's management interface as root, and make the hardware available to the virtual machines by configuring the virtual devices. The following steps provide more detail.

Notes:
* Fibrechannel tape devices may work in the ESX Server console OS. They are not supported in virtual machines.
* If the ESX Server console OS sees the tape device, install the ESX Server3.x specific backup software agent that has support for your tape device.
* If no ESXServer 3.x specific backup agent is provided by your backup software vendor, you might try to install the backup agent your backup software vendor supplies for Red Hat EL3 U6. You should test this agent on an ESX Server 3.x test bed before installing on your ESXServer 3.x production system.
* See vi3_server_config.pdf, pg 281-2 for additional information.

Part 1 - Connect the tape drive to the ESX Server host and make it available to the service console.

1. Make sure the tape drive is connected to an Adaptec SCSI card, not a RAID controller. For a list of supported Adaptec cards, see http://www.vmware.com/pdf/vi3_io_guide.pdf.

2. As a bestpractice, dedicate a SCSI card to the tape device. (The tape deviceis the only device attached to the SCSI card.)

3. Check that the service console sees the tape drive:
# cat/proc/scsi/scsi
Host: scsi1Channel: 00 Id: 03 Lun: 00
Vendor: IBM
Model: ULTRIUM-TD2 Rev: 36M3

Note: If the tape device does not show up, perform a rescan of the Adaptec HBA using esxcfg-rescan. See Using esxcfg-rescan from the command line and the Virtual Infrastructure Client to perform a rescan of the storage (1003988).

4. Use either the management interface or VirtualCenter to map a SCSI target from the controller to your virtual machine.

5. Find what path the tape drive was given by the VMkernel:

# cat/proc/vmware/scsi/vmhba1/3:0

Vendor: IBM
Model: ULTRIUM-TD2 Rev: 36M3

Type:Sequential-Access ANSI SCSI revision: 04

Id: 31 31 31 30 30 31 32 34 31 30 55 4c 54 52 49 55

Size: 0 Mbytes

Queue Depth: 2

6. Add aSCSI generic device, using a unique SCSI target ID that is different from the local boot device. Use the management interface to assign vmhba1:3:0:0. In the .vmx file, the tape drive lines should look like this:
scsi1:3.present = "TRUE"
scsi1:3.deviceType = "scsi-passthru"
scsi1:3.name ="vmhba1:3:0:0"
Note: You cannot dedicate the entire SCSI controller to a virtual machine. You must manage it one SCSI ID at a time. If you're using a robotic tape library, you'll need to assign one SCSI ID for each tape drive and also one for the robotic changer.

Note: Tape drives are currently only supported using Adaptec SCSI cards that use the LSI Logic virtual SCSI controller. Make sure you use the LSI Logic virtual SCSI controller.

To determine what the vmhba address should be in the .vmx file, use this guideline. As a general rule, vmhbaX:Y:Z:0 should correspond to /proc/vmware/scsi/vmhbaX/Y:Z.

7. Using the management interface, add the hardware to the ESX Server system.

1. To add the tape drive, which is the first device, choose Hardware > Add Device > Generic SCSI Device.

2. To add the media changer, choose Add device > Generic SCSI device. Under Device Connection, select Manually. Specify a device, then enter the information accordingly.

Part 2 - Make thetape drive available to a virtual machine.

Make sure the SCSI controller attaching the tape drives and medium changer is dedicated
to the virtual machine only.

To confirm that the SCSI controller is dedicated:

1. Log on to the management interface as root or an administrative user.

2. Right-click VM.

3. ClickConfigure Hardware.

4. Look for the SCSI Controller section. Bus Sharing should be none.

To change the SCSI controller if it is shared:

1. Click the SCSI Controller link.

2. Choose none from the Bus Sharing pull-down menu.

1 comment:

Unknown said...

Hello,

Can we attach Tape drive to the Virtual Machine on Xenserver 5.6?

Thanks

Karthikkumar.M