Re: Duplicate existing FreeBSD Server in VM

2007-12-10 Thread Simon Gao
DAve wrote:
 Terry Sposato wrote:
   
 Hi,

  

 I have just installed a machine and have it setup running a web based CRM
 solution. I want to have an exact duplicate of this machine running as a VM
 for redundancy reasons. 

  

 What is the best way to go about getting this exact machine transferred to
 the VM? Both machines exist on the same network and will be able to talk to
 each other, I have been thinking of a couple of different ways to get all my
 data across which is the easy part, but I want to match everything that is
 installed, base system, ports etc.

  

 Anyone have any ideas or point me into the right direction?

 

 You can use dump over ssh easily enough, here are my notes from using it
 to create multiple production machines from a single test server. There
 are better ways I am sure, but this is quick and easy if you are
 familiar with FreeBSD installs.

 Note #1 In the first comment line I say to boot the live file system CD,
 that is what you would do in the VM, just as you would normally boot an
 installer CD, but use a Live filesystem CD instead.

 Note #2 I used several slices with sizes some may not agree with. It was
 a choice we made for various reasons, the servers have been running for
 three years. You may have more or less slices of varying sizes, adjust
 the steps below to your preferences.

 Note #3 You will need to check and WRITE DOWN which slice is which mount
 point, /, /var, /usr and so on. Your disks may be different if you
 choose not to create a seperate /tmp, or /var.

 I'll be out of the office for a week, but you can try and adjust as
 needed, it won't hurt anything and you can always overwrite and try
 again. WRITE IT DOWN.

 Works for us, I've used it several times, adjusting as needed for the
 system I am cloning.

 DAve

 

 # boot live filesystem cd
 # use disklabel to check/create slices
 /stand/sysinstall
 /dev/ad0s1b256mb   swap
 /dev/ad0s1a256mb   /mnt/ufs.1softupdates
 /dev/ad0s1e256mb   /mnt/ufs.2softupdates
 /dev/ad0s1d256mb   /mnt/ufs.3softupdates
 /dev/ad0s1fall /mnt/ufs.4softupdates
 /dev/ad1s1d2mb /mnt/ufs.5

 # unmount the new slices
 umount /mnt/ufs.1
 umount /mnt/ufs.2
 umount /mnt/ufs.3
 umount /mnt/ufs.4
 umount /mnt/ufs.5

 # make newfs on each slice
 newnfs /dev/ad0s1a
 newnfs /dev/ad0s1e
 newnfs /dev/ad0s1f
 newnfs /dev/ad0s1d
 newnfs /dev/ad1s1d

 # remount the slices
 mount -t ufs -o rw /dev/ad0s1a /mnt/ufs.1
 mount -t ufs -o rw /dev/ad0s1e /mnt/ufs.2
 mount -t ufs -o rw /dev/ad0s1d /mnt/ufs.3
 mount -t ufs -o rw /dev/ad0s1f /mnt/ufs.4

 # fetch the filesystems from the test server
 # you will need to enable root ssh access on the test server for this.
 cd /mnt/ufs.1
 ssh [EMAIL PROTECTED] dump -0L -f - /dev/ad0s1a | restore -rf - /dev/ad0s1a
 cd /mnt/ufs.2
 ssh [EMAIL PROTECTED] dump -0L -f - /dev/ad0s1e | restore -rf - /dev/ad0s1e
 cd /mnt/ufs.3
 ssh [EMAIL PROTECTED] dump -0L -f - /dev/ad0s1f | restore -rf - /dev/ad0s1f
 cd /mnt/ufs.4
 ssh [EMAIL PROTECTED] dump -0L -f - /dev/ad0s1d | restore -rf - /dev/ad0s1d

 # change the following entries in rc.conf, remember everything is
 mounted under /mnt!
 # X = the ecluster number 1,2,3,4,5,6,7,8, etc.
 hostname=new_server_X
 ifconfig_em0=inet 10.0.240.13X netmask 255.255.255.0

 Reboot the new server, it should come up just fine.


   
Your instructions is very helpful. When using on 4.11, -L seems not
working with dump.

Also I have one question, I clone file system from one machine to
another different type of machine. The source machine's file system is
on /dev/da0s1, but destination's is on /dev/ad0s1.  Then I run following
to update boot loader:

fdisk -B -b /boot/boot0 /dev/ad0
bsdlabel -B /dev/ad0s1

However, the cloned system can't find kernel on reboot. What am I missing?

Simon



___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Duplicate existing FreeBSD Server in VM

2007-11-07 Thread Terry Sposato
Hi,

 

I have just installed a machine and have it setup running a web based CRM
solution. I want to have an exact duplicate of this machine running as a VM
for redundancy reasons. 

 

What is the best way to go about getting this exact machine transferred to
the VM? Both machines exist on the same network and will be able to talk to
each other, I have been thinking of a couple of different ways to get all my
data across which is the easy part, but I want to match everything that is
installed, base system, ports etc.

 

Anyone have any ideas or point me into the right direction?

 

I know I have already asked this question but there is a slight difference,
the real server is running FreeBSD 6.2-RELEASE-p8 AMD64 version. The
duplicated version which will be running in a VM is only going to be the
i386 version. What would be the best way to attack this problem? 

 

The stuff that needs to be synced would be a MySQL database along with a
website. Everything else probably doesn't matter...

 

Regards,

 

Terry

http://www.sucked-in.com

Have you been sucked in?

 

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Duplicate existing FreeBSD Server in VM

2007-11-03 Thread Uwe Laverenz
On Fri, Nov 02, 2007 at 12:46:09PM +1100, Terry Sposato wrote:

 I have just installed a machine and have it setup running a web based CRM
 solution. I want to have an exact duplicate of this machine running as a VM
 for redundancy reasons. 

The best and easiest way I know of is using /usr/ports/net/rsync for
this task. I often used it to move BSD or Linux systems to new hardware
or transfer them into a VM.

I usually make sure that the kernel supports all important hardware on
the target machine and that /etc/fstab is correct. After that I start
to transfer filesystem after filesystem with e.g.:

   # rsync -avxH --delete --exclude /etc/fstab / [EMAIL PROTECTED]:/

You might want to exclude other files (e.g. /etc/rc.conf) from being
overwritten, I guess.

The nice thing with rsync is that only diffs are transferred, so it would
be easy and fast to keep your VM in sync with the source machine.

Uwe

P.S.:
Yesterday I moved a FreeBSD 4.5 system from a Proliant 3000 (~7 years old)
to a VMware Server VM using rsync. All I had to take care of was the use
of a GENERIC kernel, a new /etc/fstab and a changed ifconfig line in
/etc/rc.conf.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Duplicate existing FreeBSD Server in VM

2007-11-02 Thread Mark Foster
Terry Sposato wrote:
 What is the best way to go about getting this exact machine transferred to
 the VM? Both machines exist on the same network and will be able to talk to
 each other, I have been thinking of a couple of different ways to get all my
 data across which is the easy part, but I want to match everything that is
 installed, base system, ports etc.

  

 Anyone have any ideas or point me into the right direction?
   
There are a # of ways to skin that cat.
Have a look at my Linux P2V page as it describes a process that should
work for you.
http://mark.foster.cc/wiki/index.php/Linux_P2V

-- 
Said one park ranger, 'There is considerable overlap between the 
 intelligence of the smartest bears and the dumbest tourists.'
Mark D. Foster, CISSP [EMAIL PROTECTED]  http://mark.foster.cc/

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Duplicate existing FreeBSD Server in VM

2007-11-01 Thread Terry Sposato
Hi,

 

I have just installed a machine and have it setup running a web based CRM
solution. I want to have an exact duplicate of this machine running as a VM
for redundancy reasons. 

 

What is the best way to go about getting this exact machine transferred to
the VM? Both machines exist on the same network and will be able to talk to
each other, I have been thinking of a couple of different ways to get all my
data across which is the easy part, but I want to match everything that is
installed, base system, ports etc.

 

Anyone have any ideas or point me into the right direction?

 

Regards,

 

Terry

http://www.sucked-in.com

Have you been sucked in?

 

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Duplicate existing FreeBSD Server in VM

2007-11-01 Thread DAve
Terry Sposato wrote:
 Hi,
 
  
 
 I have just installed a machine and have it setup running a web based CRM
 solution. I want to have an exact duplicate of this machine running as a VM
 for redundancy reasons. 
 
  
 
 What is the best way to go about getting this exact machine transferred to
 the VM? Both machines exist on the same network and will be able to talk to
 each other, I have been thinking of a couple of different ways to get all my
 data across which is the easy part, but I want to match everything that is
 installed, base system, ports etc.
 
  
 
 Anyone have any ideas or point me into the right direction?
 

You can use dump over ssh easily enough, here are my notes from using it
to create multiple production machines from a single test server. There
are better ways I am sure, but this is quick and easy if you are
familiar with FreeBSD installs.

Note #1 In the first comment line I say to boot the live file system CD,
that is what you would do in the VM, just as you would normally boot an
installer CD, but use a Live filesystem CD instead.

Note #2 I used several slices with sizes some may not agree with. It was
a choice we made for various reasons, the servers have been running for
three years. You may have more or less slices of varying sizes, adjust
the steps below to your preferences.

Note #3 You will need to check and WRITE DOWN which slice is which mount
point, /, /var, /usr and so on. Your disks may be different if you
choose not to create a seperate /tmp, or /var.

I'll be out of the office for a week, but you can try and adjust as
needed, it won't hurt anything and you can always overwrite and try
again. WRITE IT DOWN.

Works for us, I've used it several times, adjusting as needed for the
system I am cloning.

DAve



# boot live filesystem cd
# use disklabel to check/create slices
/stand/sysinstall
/dev/ad0s1b256mb   swap
/dev/ad0s1a256mb   /mnt/ufs.1softupdates
/dev/ad0s1e256mb   /mnt/ufs.2softupdates
/dev/ad0s1d256mb   /mnt/ufs.3softupdates
/dev/ad0s1fall /mnt/ufs.4softupdates
/dev/ad1s1d2mb /mnt/ufs.5

# unmount the new slices
umount /mnt/ufs.1
umount /mnt/ufs.2
umount /mnt/ufs.3
umount /mnt/ufs.4
umount /mnt/ufs.5

# make newfs on each slice
newnfs /dev/ad0s1a
newnfs /dev/ad0s1e
newnfs /dev/ad0s1f
newnfs /dev/ad0s1d
newnfs /dev/ad1s1d

# remount the slices
mount -t ufs -o rw /dev/ad0s1a /mnt/ufs.1
mount -t ufs -o rw /dev/ad0s1e /mnt/ufs.2
mount -t ufs -o rw /dev/ad0s1d /mnt/ufs.3
mount -t ufs -o rw /dev/ad0s1f /mnt/ufs.4

# fetch the filesystems from the test server
# you will need to enable root ssh access on the test server for this.
cd /mnt/ufs.1
ssh [EMAIL PROTECTED] dump -0L -f - /dev/ad0s1a | restore -rf - /dev/ad0s1a
cd /mnt/ufs.2
ssh [EMAIL PROTECTED] dump -0L -f - /dev/ad0s1e | restore -rf - /dev/ad0s1e
cd /mnt/ufs.3
ssh [EMAIL PROTECTED] dump -0L -f - /dev/ad0s1f | restore -rf - /dev/ad0s1f
cd /mnt/ufs.4
ssh [EMAIL PROTECTED] dump -0L -f - /dev/ad0s1d | restore -rf - /dev/ad0s1d

# change the following entries in rc.conf, remember everything is
mounted under /mnt!
# X = the ecluster number 1,2,3,4,5,6,7,8, etc.
hostname=new_server_X
ifconfig_em0=inet 10.0.240.13X netmask 255.255.255.0

Reboot the new server, it should come up just fine.


-- 
Three years now I've asked Google why they don't have a
logo change for Memorial Day. Why do they choose to do logos
for other non-international holidays, but nothing for
Veterans?

Maybe they forgot who made that choice possible.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]