Editing Physical to container

Jump to: navigation, search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 7: Line 7:
 
To make things easier you may like to first follow the basic instructions elsewhere and create a dummy container based on the same Linux distribution you want to migrate. That way you can take that dummy as a template and then copy to your new migrated container and modify. You can later discard this dummy.
 
To make things easier you may like to first follow the basic instructions elsewhere and create a dummy container based on the same Linux distribution you want to migrate. That way you can take that dummy as a template and then copy to your new migrated container and modify. You can later discard this dummy.
  
{{Note|Still better is to use this container from the same Linux distribution you want to migrate as the starting point for the new installation. In this case, if we are carefull to copy only the needed files from the original system, we will be able to skip many of the following steps.}}
 
  
 
== Prepare a new “empty” container ==
 
== Prepare a new “empty” container ==
Line 16: Line 15:
 
</source>  
 
</source>  
  
{{Note|Now comes the dummy container handy mentioned above: Simply copy the xxx.conf file of the dummy to your new yyy.conf and modify it.}}
+
<b>Hint:</b> Now comes the dummy container handy mentioned above: Simply copy the xxx.conf file of the dummy to your new yyy.conf and modify it.
 
 
{{Note|If you have created a container from the same distro as the basis for the migration, simply take note of the CT ID and skip this step.}}
 
  
 
== Copying the data ==
 
== Copying the data ==
Line 33: Line 30:
 
/etc/mtab
 
/etc/mtab
 
/etc/lvm
 
/etc/lvm
/etc/fstab
 
/etc/udev
 
 
</pre>
 
</pre>
  
Line 81: Line 76:
 
You have to add <code>OSTEMPLATE=xxx</code> line to <code>/etc/vz/conf/123.conf</code> file, where <code>xxx</code> would be distribution name (like <code>debian-3.0</code>) for vzctl to be able to make changes specific for this distribution.
 
You have to add <code>OSTEMPLATE=xxx</code> line to <code>/etc/vz/conf/123.conf</code> file, where <code>xxx</code> would be distribution name (like <code>debian-3.0</code>) for vzctl to be able to make changes specific for this distribution.
  
{{Note|If you copied from the dummy container or are using it as basis for your migrated system then this step is already accomplished.}}
+
If you copied from the dummy container then this step is already accomplished.
  
 
=== IP address(es) ===
 
=== IP address(es) ===
Line 132: Line 127:
  
 
=== /dev ===
 
=== /dev ===
{{Note| Once again if you are using the container from the same distro as basis, and you were carefull to not overwrite <code>/dev</code> with <b>rsync</b> by using the <code>--one-file-system</code> option, you can skip this section}}
 
  
 
==== Introduction: static /dev ====
 
==== Introduction: static /dev ====
Line 145: Line 139:
 
Please pay attention to the access permissions of the device files being created: a default file mode for newly created files is affected by <code>umask</code> ([[w:umask]]). You can use --mode option for <code>mknod</code> to set the desired permissions.
 
Please pay attention to the access permissions of the device files being created: a default file mode for newly created files is affected by <code>umask</code> ([[w:umask]]). You can use --mode option for <code>mknod</code> to set the desired permissions.
  
{{Note|Now comes the dummy container handy mentioned above: Simply copy the entire /dev directory of the dummy to your new migrated container - worked in my case at least with Debian Etch.}}
+
Hint:
 +
Now comes the dummy container handy mentioned above: Simply copy the entire /dev directory of the dummy to your new migrated container - worked in my case at least with Debian Etch.
  
 
==== tty device nodes ====
 
==== tty device nodes ====
Line 186: Line 181:
  
 
===/proc===
 
===/proc===
{{Note| One more time you may skip this if you are using a container created from a template of the same distro as your basis system.}}
 
 
 
Make sure the /proc directory exists:
 
Make sure the /proc directory exists:
 
  ls -la /vz/private/123/ | grep proc
 
  ls -la /vz/private/123/ | grep proc
Line 196: Line 189:
 
=== /etc/init.d services ===
 
=== /etc/init.d services ===
  
Some system services can (or in some cases should) be disabled and/or uninstaled. A few good candidates are:
+
Some system services can (or in some cases should) be disabled. A few good candidates are:
  
 
* acpid, amd (not needed)
 
* acpid, amd (not needed)
Line 208: Line 201:
 
* lm_sensors (container does not have access to hardware sensors)
 
* lm_sensors (container does not have access to hardware sensors)
 
* microcodectl (container can not update CPU microcode)
 
* microcodectl (container can not update CPU microcode)
* netplugd (container does not have real Ethernet device)
+
* netplugd (container does not have real Ethernet device)  
* irqbalance (this is handled in host node)
 
* auditd ( not needed in container)
 
* lvm2-monitor (no LVM in containers)
 
* ntp/ntpd (clock taken from host node)
 
  
 
To see which services are enabled:
 
To see which services are enabled:
Line 371: Line 360:
 
* Debian 6.0.4 with DTC Hosting Contro Panel . 15:00, 14 May 2012
 
* Debian 6.0.4 with DTC Hosting Contro Panel . 15:00, 14 May 2012
 
* Debian 6, LAMP with ISPManager CP (no adjustments were made, just transferred the file structure and created  ctid.conf) 03:19, 15 Jun 2012
 
* Debian 6, LAMP with ISPManager CP (no adjustments were made, just transferred the file structure and created  ctid.conf) 03:19, 15 Jun 2012
* Debian 5.0.3, with Mysql, Apache, ISCP omega, Postfix, etc --[[Special:Contributions/91.143.222.253|91.143.222.253]] 19:47, 28 June 2012 (EDT)
 
* Debian 6.0.5 with artica-zarafa, 20 Nov 2012
 

Please note that all contributions to OpenVZ Virtuozzo Containers Wiki may be edited, altered, or removed by other contributors. If you don't want your writing to be edited mercilessly, then don't submit it here.
If you are going to add external links to an article, read the External links policy first!

To edit this page, please answer the question that appears below (more info):

Cancel Editing help (opens in new window)

Templates used on this page: