To migrate a CentOS / cPanel virtual machine from VMWare to Hyper-V there are a few steps you need to remember if you want to keep things easy.
The following steps assume you're attempting to migrate an existing CentOS installation, between host servers in the same network, eg you don't need or want to change any settings on the guest server like IP addresses etc. Simply convert, copy, import and power up.
Before shutting down the guest, it's advisable to uninstall the VMWare Tools from the server if they have been installed. While not always an issue, there are some reports of people having difficulties uninstalling it once the server has been migrated. Additionally, I'd suggest installing the Hyper-V Linux Integration Services prior to migration (current version at time of writing is 3.5 available here http://www.microsoft.com/en-gb/download/details.aspx?id=41554). This ensures when you power up the guest in Hyper-V that you don't have any issues with it recognising the network adaptor.
Linux installations hard code the MAC address of the NIC alongside the IP address details, which means if the MAC address changes (as it will by default when moving to another host), you'll find your network settings no longer work. Make a note of the current MAC address, either from the network settings in VMWare, or by looking in /etc/sysconfig/networking/devices/ifcfg-eth0.
Shutdown the server being migrated, and copy the files to the new Hyper-V server to convert them. You could convert them on the old server, but it's probably older and slower (hence you migrating) so moving them now saves time.
To convert the files I recommend using WinImage. Simply point it at the target vmdk file, tell it where to put the resulting .vhd file and its name, and it gets on with it. Note, some people report issues converting single large vmdk files (I don't know if this applies to WinImage), in which case the advise is to use VMWare Converter to split them into smaller files before the conversion. Once finished, copy the now converted .vhd file into the folder you'll create as part of the setup for the VM in the next step.
While the conversion is taking place create the new Hyper-V VM. At time of writing it will need to be a generation 1 virtual machine if you're running 2012 R2, as CentOS doesn't support generation 2 machines. Create the VM as normal, but when prompted to configure the HDD choose the option to Attach a virtual hard disk later.
Once configured, go into the Settings for the new VM. Newer versions of CentOS may be fine, but for 5.10 I found the NIC must be configured as a Legacy Network Adaptor, so remove the Network Adaptor that's there and then add a Legacy Network Adaptor instead. Within the Adaptor settings, go into the Advanced Features and statically assign the MAC address to the one you previously recorded from VMWare. Finally, select IDE Controller 0, select Hard Drive and click Add, then click Browse and find the .vhd file you converted earlier. Obviously if you have multiple drives then repeat this for each of them.
Once all this is done you can start the VM. You should find it starts successfully and works exactly the same as previously without the need to adjust anything on the server.
Showing posts with label cPanel. Show all posts
Showing posts with label cPanel. Show all posts
Sunday, 30 March 2014
Wednesday, 31 October 2012
Changing the cPanel "Configure Email Client" server addresses in WHM 11.34
One of the great things about cPanel is how easy it makes it for
non-technical people to use, for instance within Email Accounts, clicking More
and then Configure Email Client provides you with links to automatically
configure several email clients, or the details required to do it manually. The
data is automatically generated to show the relevant domain's POP3/IMAP/SMTP
server details (specific to each domain), but what if you prefer to have a
single set of service addresses, how do you update this page to show your
preferred details.
In the previous version it was quite simple, you simply edited the
clientconfinclude.html that's found within
/usr/local/cpanel/base/frontend/x3/mail/ and replaced the dynamic code with your
static text.
With WHM 11.34 that's changed, and the .html file no longer controls any of
the data, instead it calls the template file clientconfinclude.tmpl which then
generates all of the content. Simply doing the switch like before isn't as
simple any more, especially if you're not much of a coder, but it's still doable
with some minor modifications. Unfortunately the code seems to use multiple
methods to call the server addresses, so you have to do different mods for
different sections of code.
First all we have the SSL hosts, which is easily the simplest part. Line 11
to line 24 deals with getting those details, with the next section storing them
for use later. Without deleting anything simply insert these three new lines
immediately before line 26 that begins "SET ssl_hosts = {" :
SET imap_ssl_host = 'imap.mydomain.com';
SET pop3_ssl_host = 'pop3.mydomain.com';SET smtp_ssl_host = 'smtp.mydomain.com';
That will then force all SSL references to use your information. Now look
for the line :
SET non_ssl_mail_server = webmail_settings.domain;
Copy it, and edit the entries so you have :
SET non_ssl_mail_server = 'pop3.mydomain.com';
SET non_ssl_mail_server_smtp = 'smtp.mydomain.com';
In the manual settings section, if you'd prefer the default POP3/IMAP to be
IMAP then change pop3 to imap above. Now look for the line :
at around line 685. On the next line, change "non_ssl_mail_server" to be
"non_ssl_mail_server_smtp" (so it matches the name used in the last step).
If you save this file and reload the page you should now find most of the
links / text now points to your preferred addresses. Unfortunately it's not
perfect, there are a few entries that display incorrectly, and I haven't yet
worked out where they get their information or how to change it, but hopefully
it will be a bit of help for someone.
Subscribe to:
Posts (Atom)