How to perform a NetWare Physical to Virtual conversion using free tools.
Recently I had the requirement to duplicate a production server in a test environment. The source server was NetWare 6.5 running on HP Proliant DL380 G4 hardware. As all of our servers use a pair of mirrored disks for the system (dos partition and SYS pool / volume), the most obvious solution was to remove one of the system disks and put it into some spare (and reasonably similar) hardware. This would certainly work, but would mean that I would be fairly limited in maintaining a roll back position for when my testing went wrong and I wanted to start over.
Virtualisation is a popular technology these days (rightly so) and is a perfect fit for a test environment where you wish to be able to quickly recover to a known point and potentially spawn additional copies of your test environment. I decided to investigate my options for performing a NetWare Physical to Virtual (P2V) conversion.
The only current commercial offering I could find was Portlock Storage Manager (www.portlock.com) which looks like a very powerful tool, but was a little too expensive for what I needed (but could be a good option for doing production conversions).
I decided to see if I could make something work with free tools, and after a little experimentation and a lot of googling, found a bunch of tools and a process that has worked for me and which I will describe in this article.
- Windows XP Workstation with the NetWare Client and enough storage to hold an image of our source server (an external USB drive is handy for this)
- Clonezilla 1.2.2-26 Live CD (www.clonezilla.org)
- Linux based GPL imaging solution
- VMware ESXi 4 (www.vmware.com)
- DR-Dos 7.0.3 (www.drdos.net)
- A free DOS we can use to boot our NetWare Server
- Hint – you if own Nero Burning ROM you can create a DR-DOS boot CD by burning a blank “bootable” CD-ROM (MagicISO can turn this into an ISO file for you)
- You can download this one I generated (and which includes XCOPY) – DR-DOS.iso
- MagicISO (www.magiciso.com)
- Shareware ISO manipulation software, the trial version is capable of managing ISO’s up to 300MB which is sufficient for the use we put it to in this process
The skills needed to complete this exercise are:
- Intermediate with VMWare ESXi
- Intermediate with NetWare 6.5
- Intermediate General IT skills
Summary of the process:
The concept of what we want to do is relatively straight forward. We simply want to take an image of our existing server which is hosted on physical hardware and restore this image into a virtual machine hosted on our ESXi hypervisor.
Pros of approach:
- Cheap (the only cost is your time, which to be fair might not be cheap)
- Source server remains unmodified
- Seems to work
Cons of approach:
- Quite a bit of down time required
- Source server imaging occurs offline
- If you are replacing the source server, then the time is doubled due to the restore time
Step 1: Preparation
- Download the following software and have it available on your workstation
- Clonezilla 1.2.2-26 Live CD
- DR-DOS 7.0.3 Boot CD / ISO image
Note – if you use the Nero generated ISO, it does not include XCOPY (which will save you a lot of time later on), so download XCOPY.EXE from the DR-DOS website and include it in your ISO (with MagicISO – you’ll see how to do this later in this article)
- Magic ISO (install on your workstation)
- Ensure you have a VMware ESXi 4 hypervisor configured and running that has the capacity required to host the new virtual server. Setting up ESXi is beyond this scope of this article but more information can be found on the VMWare website.
- Ensure you can make an NCP connection to the source server you want to convert and have the appropriate server privileges (essentially you should be supervisor of the server).
- Ensure you have enough disk capacity on your workstation to hold an image of the source server’s entire system disk. An external USB drive might be useful here, especially if your production and test networks are separated (this is a very good idea BTW).
- Setup a Windows Share on your client PC
- Ensure this is where you have allocated the disk space for the source server image as this is the location we will send our image to.
- Create a new Virtual Machine which we will move the image of our physical server to
- Amount of RAM should be the same as the source physical server
- SCSI controller should be of type LSI Logic Parallel
- Local Hard Disk should be SCSI and made slightly larger than the source physical servers disk (in this example the source servers disk is 36GB so I have created a 40GB virtual disk)
- The virtual network adaptor should be created as a “Flexible” adaptor
- Connect to the console of your source server and load the DOSFAT module (see Figure 1). With the DOSFAT module loaded, the source servers DOS volume (C drive) will be available as an NCP volume. In this case it is presented as DOSFAT_C
Figure 1 (Load DOSFAT)
- Now connect to this volume from your windows client (see Figure 2) and copy its entire contents
Figure 2 (Servers C Drive as a NetWare Volume)
We need to copy the contents of the servers C drive is so that later in the process we can restore the virtual server’s C drive to the same state. My experience with imaging HP servers has been that the DOS partition will come across, but will not be bootable and this does not seem to be easily fixable. It may be to do with some issue around the differences in geometry between the physical and virtual disks but to be honest I don’t completely understand the issues and reformatting the DOS partition resolves the issue quickly and easily and so that has been my approach.
Step 2: Image the source server
- Shutdown the source server
- Load the Clonezilla 1.2.2-26 Live CD into the CD-ROM drive of the source server and boot from it (note that in my case I used the HP Integrated Lights Out Functionality to remotely mount the ISO image on the server, and remote control the physical console see Figure 3 and 4 )
Figure 3 (HP iLO is used to mount the Clonezilla ISO on the source server)
Figure 4 (HP iLO is used to view the servers physical console as Clonezilla Boots)
- At the Clonezilla splash screen, select the appropriate screen resolution for your server (in this case 800×600 works well)
- Next you will be prompted to select the language you prefer to work in (this guide assumes English), so choose English
- Next you will be prompted to select the KeyMap you prefer to use, I choose “Don’t Touch KeyMap”
- The LiveCD will now ask if you wish to start Clonezilla or drop to the command line, you should choose to start Clonezilla (see Figure 5)
Figure 5 (Start Clonezilla)
- Clonezilla now needs to know what mode you wish to operate in, device to image or device to device. We want to use device-image. This mode can be used to create a file based image of a physical storage device in our source server, so choose device-image (see Figure 6)
Figure 6 (choose device-image mode)
- Clonezilla will now ask what it should use as the device for storing / retrieving image files. In this example we want to push the image across the network to our Windows XP client. The simplest way to do this is via the “samba_share” option which will allow us to connect to the share we set up on our Windows client earlier (see Figure 7)
Figure 7 (choose samba_server)
- As we have chosen a network location for our image file, we are now prompted for how we would like to configure the IP address to be used by Clonezilla. For this example we will use a static address (see Figure 8), and I would recommend that you don’t use the same IP address that the source NetWare server has been allocated
Figure 8 (choose how to assign a network address – we will use static)
- You will be prompted for the following information
- IP address for eth0 (the local IP address to assign to Clonezilla)
- Enter a valid IP address on your network and click OK (or hit enter)
- Network Mask
- Enter the network mask for your network and click OK (or hit enter)
- Default Gateway
- Enter the default gateway for your network – this is especially important if your client machine is located on a different subnet to your source server. If you do not have or need a gateway, select cancel on this dialogue (rather than OK)
- Enter the IP address of the nameserver(s) on your network. This is not required if you are connecting via IP addresses (which is the simplest way to do it). Again, clicking on cancel will bypass this parameter
- Mount Samba Server
- Enter the IP address of your Windows XP client machine (the location where you created the Windows Share earlier) and click OK (See Figure 9.)
Figure 9 (Enter the address of the machine that will receive the image file)
- Samba Server Domain
- If your windows XP client belongs to an Active Directory or NT domain, this is where you specify its name. If your client is simply in a workgroup you can leave this dialogue empty and click cancel (my client was in a workgroup so I have not tested how domain membership affects connectivity)
- Samba Server User Name
- Enter the username of a user on your Windows client that has permissions to connect to the share you configured earlier (see Figure 10)
Figure 10 (Enter the username to connect to your Windows share as)
- Samba Share Name (Directory Name)
- Enter the name of the share that you created on your Windows client (see Figure 11) – i.e the name of the share you will connect to for saving the image
Figure 11 (Enter the name of the share you created on your Windows client)
- Finally you will be prompted for the password (of the user account specified above) to be used to connect to the share on your Windows client. If the connection is successful you will see a filesystem summary displayed that shows your Windows share mapped to /home/partimag on the Clonezilla machine (see Figure 12). Hit enter to continue.
Figure 12 (Clonezilla successfully mounted our Windows share)
- Now you will be asked if you would like to run the “Beginner” or “Expert” wizard for imaging (Figure 13). After some experimentation, I came to the conclusion that Beginner mode does fine for imaging up a source NetWare server. In beginner mode Clonezilla will step through its available imaging tools looking for the most appropriate one to image our source server. As there are no specific tools in Clonezilla that know about NSS partitions, it will eventually drop down to using “DD” to create the image of the NSS partition (and partimage for the DOS partition). By default, the beginner wizard will also compress the image (using gzip) and split the image file into 2GB chunks. The smart thing about Clonezilla is that it will also take a copy of the partition table which it will use to reconstruct our disk when we restore it.
Figure 13 (We choose the Beginner wizard)
- After selecting the “Beginner” wizard, Clonezilla will ask us what type of imaging operation we would like to perform. In this case we want to perform a “savedisk” operation which images a disk in its entirety (see Figure 14).
Figure 14 (We choose the savedisk imaging option)
- Next we are required to enter the name of the image we are taking (see Figure 15) – in this case I have called it Replica-img. Clonezilla will create a directory in the root of the Windows Share named “Replica-img” into which all of the imaging data for this server will be saved.
Figure 15 (Name our image)
- Next we need to choose the source disk we wish to image (see Figure 16). In this case there is only one disk in our system, so the choice is easy. It is entirely possible however that you might wish to image a server with multiple disks. In this case, if the other disks simply contain data, it may simply be easier to restore this data onto the Virtual server once it has been provisioned. One exception to this is where NSS partitions span disks. If your SYS volume spans disks, you will need to image all disks and bring them all across to the virtual environment as if you don’t, you wont have all of the data that makes up that volume. This process has only been tested with single disk (or LUN in the case of a “disk” being made up of a mirrored pair of disks) where the SYS pool/volume does not span outside of this set.
Figure 16 (select the source disk to image)
- Clonezilla will now provide a summary of the command it will use to image the device and ask for confirmation before beginning. Assuming that the location you wish to save your image (the windows share that clonezilla has connected to) is writable, the imaging process will begin and provide a progress indicator (see Figure 17)
Figure 17 (Imaging process commences)
- Once the imaging process is complete (see you can remove the Clonezilla CD-ROM / disconnect the ISO and reboot the server. In this example we are taking the image to deploy into a test environment so we will bring the source server back up. If the target server was intended to replace the source server, then we would power down the source server and physically disconnect it from the network to avoid any potential server conflicts.
Step 3: Restore the image to the virtual server
Now that we have an image of our source server we need to reverse the process to extract the image to our virtual server. The virtual server requires network access to a Windows share that contains the image we took in step 2. Because in this example we are migrating the source server to a test environment, the source server will remain online and so the test environment must be isolated from production (or the network the source server operates on) to avoid server conflicts.
In this example I take the external USB drive that was connected to my Windows XP workstation and connect it to a Windows XP workstation on my test network. The networks that my source (physical) and destination (virtual) servers are connected to are PHYSICALLY ISOLATED and there is no chance of cross contamination. Please ensure this is the case for you if you are leaving the source server operational.
Clonezilla is used to restore the source image into the virtual machine. The process for starting Clonezilla and connecting to our Windows XP client (windows share) is identical to that described above in Step 2 “Image the Source Server” and so will not be repeated here. This step will describe the differences between restoring and creating an image and any specific’s around the virtual environment.
- Connect the virtual CDROM drive of your destination virtual server to the Clonezilla 1.2.2-26 Live CD ISO image (see Figure 18)
Figure 18 (Connect the Clonezilla ISO to your virtual server)
- Power on your virtual server, boot with the Clonezilla Live ISO and proceed with Clonezilla configuration up until the Clonezilla “Imaging Operation” selection dialogue (see Figure 19)
Figure 19 (Imaging Operation Selection Screen)
- On the imaging operation screen (see Figure 19), select the “restoredisk” option. This option will restore our previously saved image back to a physical device (or in this case a physical drive virtualized by the VMware hypervisor)
- A list of available images will now be displayed from which you can choose the image to restore (see Figure 20). In this example we will choose “Replica-img” which is the image we created in Step 2 above.
Figure 20 (select the image to restore)
- Now we will be prompted to select the local disk device onto which to restore the image (see Figure 21). As this virtual server only has one disk device, we only have one option.
Figure 21 (select target disk device to restore the image to)
- Clonezilla will now provide a summary of the command it will use to restore the image to the device, along with a summary of the layout to be restore and ask for confirmation before beginning (see Figure 22)
Clonezilla will now restore the partition table and the data from the image (see Figures 23 and 24)
Figure 23 (Clonezilla rewrites the partition table based on the image)
Figure 24 (Clonezilla restores the data from the image)
- When the imaging process completes, remove the virtual CD and reboot the virtual server. If your virtual server is anything like mine, it won’t boot (see Figure 25). If so, proceed to Step 4.
Figure 25 (Our virtual server with the image restored wont boot)
Step 4: Fix the DOS partition of the restored image
Now that we have restored the image into our virtual server it requires some work to become useable. There are two things we need to do.
- Fix the DOS boot partition (this is where DR-DOS comes in)
- Modify the NetWare installation to use the new VM hardware (disk and network controllers)
You may wish to re-use the DOS that your source server originally had installed, if so, then you will need to extrapolate the process from what is described here with DR-DOS. I have tested this with MS-DOS and it works fine. DR-DOS is simply used here in this example as it is, well, free.
The approach for fixing the DOS partition is:
- Create a DOS boot ISO/CD specific for this server (with all the source servers C drive files)
- Boot the virtual server with the DOS boot ISO/CD
- Format the virtual servers DOS partition using the tools on the boot CD
- Copy across DOS to the virtual servers DOS partition
- Copy the NWSERVER directory of the source server from the ISO to the newly formatted DOS partition
The approach for modifying the NetWare installation is:
- Remark out any hardware specific drivers (specific to the old server hardware) loaded in the servers STARTUP.NCF
- Add a line to load a suitable VMware disk device driver in the STARTUP.NCF
- Start the server with no autoexec.ncf execution
- Use HDETECT to load a suitable VMWare NIC driver
Fix the DOS boot partition
- On the Windows XP workstation onto which you installed MagicISO, make a copy of the DR-DOS ISO image. In this example, I have called the copy DR-DOS-Replica.iso. Use MagicISO to open this new DR-DOS ISO image (see Figure 26).
Figure 26 (MagicISO with the DR-DOS-Replica.iso image open)
- Now from within MagicISO, copy across the source servers C drive that we backed up to our Workstation in Step 1 (see Figure 27). In this example the source servers C drive is backed up to a directory called “Replica” that is located in another directory called “Source Server C Drive”. Using the MagicISO GUI we can drag the “Replica” directory from the bottom explorer window into the top DR-DOS-Replica.ISO image window.
Figure 27 (The source servers C drive backup directory “Replica” is added to the ISO image)
- Now use the “Save” option from the file menu to save this ISO image and then close it.
- The updated ISO image (in this example DR-DOS-Replica.ISO) should now be uploaded to a data store on the ESXi hypervisor so that it can be used by Virtual Servers. Use the vSphere client to upload this ISO to your ESXi server (see Figure 28).
Figure 28 (The new ISO file is uploaded to the ESXi server)
- Now we need to insert (or mount) this ISO on the target virtual server’s virtual CD ROM drive (see Figure 29) ensuring that the CD ROM device is connected.
Figure 29 (The FreeDOS-Replica.iso is mounted on the virtual server)
- Now boot the virtual server from the DR-DOS-Replica.iso virtual CD. You should find yourself at a DR-DOS command line prompt (see Figure 30)
Figure 30 (DR-DOS boot splash screen)
- The DOS partition on the virtual server now needs to be reformatted and the files from the source servers C drive (that we backed up earlier), copied onto the newly formatted DOS partition. Use the DOS command “format c: /s /x” to format the DOS partition and transfer the base DOS boot code (see Figure 31)
Figure 31 (The virtual servers C drive is formatted)
- Now transfer the DR-DOS support files from the A drive to the newly formatted C drive by issuing the command “xcopy a:\drdos c:\drdos /s/e/v”. Note – You will need to ensure you have xcopy on your boot ISO.
- Now copy the NWSERVER directory (this is from the original source server and is what you copied into the DR-DOS ISO image) from the virtual CDROM drive (this will be drive letter D if you are using the boot image supplied with this guide) to the C drive of your virtual server. In this example the command to use is “xcopy d:\replica\nwserver c:\nwserver /s/e/v”
- You can now eject the DR-DOS ISO image from the virtual CD-ROM drive of the virtual server and reboot. If everything has worked as expected the virtual server will boot from the C drive and drop you into a DR-DOS command prompt (see Figure 32)
Figure 32 (The virtual server has booted from the C drive to DR-DOS)
Step 5: Fix the NetWare Server Installation
The final step in the conversion process is to ensure that the appropriate device drivers load for NetWare to be able to access the VMWare virtual disk and VMWare virtual NIC. In addition, we will comment out any hardware specific drivers required for the server’s original hardware platform.
- If you are continuing from the end of Step 4 you should be at the C:\ prompt of your virtual server. Navigate to the NWSERVER directory and issue the command “edit startup.ncf” to edit the NetWare server’s startup.ncf file. Note, if you receive a message stating that the file is “read-only”, issue the following at the command prompt to make it writable “attrib startup.ncf -r”. In addition, ensure that if the “startup.bak” file exists, that it too is writable.
- Comment out any hardware specific device drivers for the old server, in this example the following lines are commented out
- LOAD CPQSHD.CDM
- LOAD CPQEAID.HAM SLOT=10018
- Add the following lines to load device support for the VMWare disk devices
NOTE: If the slot values you specify don’t work, when the server loads it will stop and prompt you to enter a valid (useable) slot number – if this occurs, ensure you update the startup.ncf with the correct value.
- LOAD SCSIHD.CDM
- LOAD IDEATA.HAM SLOT=10004
- LOAD LSIMPTNW.HAM SLOT=2
See figure 33 for the final startup.ncf as used in this example
Figure 33 (startup.ncf file for the virtual server)
- Now load the NetWare server with the command “server –na” from the NWSERVER directory. This command will start the NetWare server instance without executing the autoexec.ncf file.
- Once the NetWare server reaches the NetWare console prompt, execute the command “hdetect” (see Figure 34) to launch the NetWare hardware detection utility (see Figure 35)
Figure 34 (HDETECT is launched from the NetWare server console)
Figure 35 (HDETECT initial screen – platform device drivers)
- Select “Continue” on the initial screen to move to the Storage and Network device drivers screen (see Figure 36). This screen should indicate that no NIC driver is loaded.
Figure 36 (HDETECT shows that no NIC driver is loaded)
- Choose “Modify” from the options menu and then navigate to the “Network Boards” field and press enter.
- On the Network Board Driver screen (see Figure 37), navigate to the “Modify” option and press enter.
Figure 37 (HDETECT Network Board Driver Screen shows no drivers loaded)
- Now hit the “INS” key to insert a new driver and navigate to and select (by hitting enter) the “CNEAMD.LAN: Novell Ethernet PCNetPCI, PCnetPCI_II, PCnet-Fast” driver (see Figure 38)
Figure 38 (Navigate to and select the NIC driver)
- The NIC driver summary screen will now be shown, and should contain the correct SLOT settings (See figure 39)
Figure 39 (Selected NIC driver summary screen)
- Now choose the option to return to the driver list
- Now choose the option to return to the driver summary
- At the driver summary screen (see Figure 40), you should now see that a NIC driver is selected. Choose the option to continue.
Figure 40 (Driver summary now shows a NIC driver selected)
- The next screen (see Figure 41) allows you to configure protocols for your Network Board. Select “Configure Protocols” from the options menu, highlight the Driver in the top window and hit enter.
Figure 41 (The Protocol configuration screen for the NIC boards)
- On the board configuration screen (see Figure 42), choose the “Configure IP Protocols” option, then highlight the Ehternet_II frame type and hit enter.
Figure 42 (NIC Board Configuration Screen)
- At this point HDETECT might seem to hang if you don’t have a DHCP server on the same network as your virtual server. This is because the NetWare server attempts to discover some IP configuration details via DHCP. After around 30 seconds (if no DHCP server responds), the protocol properties screen will appear (see Figure 43).
Figure 43 (TCPIP protocol properties screen)
- Select the “Modify protocol properties” option and complete the TCPIP information as appropriate for your environment – IP address, Subnet Mask and default gateway (if you have one). Once entered, select “Continue” to return to the Network Board protocol configuration summary screen.
- Now select the “Return to driver summary” option
- Now select the “Continue” option and the driver should bind to the card
Note: You may be prompted to remove any “questionable” entries from the startup.ncf and autoexec.ncf. Questionable entries are drivers that HDETECT believes are not useable on this hardware platform
- HDETECT should now exit and the NIC should be loaded and bound – issue the command “config” from the NetWare server console to confirm (see Figure 44)
Figure 44 (The NIC is loaded and TCPIP is bound)
- Your virtual NetWare server should now be ready for use. To confirm, DOWN the server and restart.
- The final task you might like to complete is the creation of an “autoexec.bat” file on the C drive to autostart NetWare when the virtual server boots.