27.12.2012 Views

The Virtualization Cookbook for SLES 10 SP2 - z/VM - IBM

The Virtualization Cookbook for SLES 10 SP2 - z/VM - IBM

The Virtualization Cookbook for SLES 10 SP2 - z/VM - IBM

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>The</strong>re are many ways to clone Linux under z/<strong>VM</strong>. <strong>The</strong> steps in this section are just one way to<br />

do it. <strong>The</strong> following assumptions are made based on what you have done so far:<br />

► <strong>The</strong> source user ID, RH6GOLD in this example, has a root file system on L<strong>VM</strong>, located on<br />

minidisks <strong>10</strong>0-<strong>10</strong>1.<br />

► <strong>The</strong> target user ID, LINUX01 in this example, has identically sized mindisks <strong>10</strong>0-<strong>10</strong>1.<br />

► <strong>The</strong> vmcp command is available to issue z/<strong>VM</strong> CP commands<br />

► <strong>The</strong> z/<strong>VM</strong> FLASHCOPY command can be used but if you don’t have that support, the Linux<br />

dd command will work.<br />

Given these assumptions, one set of steps that can be used to clone a system is as follows:<br />

1. Link the source disks read-only.<br />

2. Link the target disks read/write.<br />

3. Copy the source to the target disk with FLASHCOPY or the Linux dd command.<br />

4. Detach the source disks.<br />

5. Bring the newly copied L<strong>VM</strong> online.<br />

6. Mount the newly copied root file system.<br />

7. Modify the networking in<strong>for</strong>mation on the target system.<br />

8. Detach the target disks.<br />

9. IPL the target system.<br />

<strong>10</strong>.Modify the SSH keys on the target system.<br />

Link the source and target disks<br />

Start an SSH session to the cloner as root.<br />

<strong>The</strong> source disks, RH6GOLD <strong>10</strong>0-<strong>10</strong>1, are linked read-only as virtual devices 1<strong>10</strong>0 and 1<strong>10</strong>1 with<br />

the CP LINK command:<br />

# vmcp link rh6gold <strong>10</strong>0 1<strong>10</strong>0 rr<br />

# vmcp link rh6gold <strong>10</strong>1 1<strong>10</strong>1 rr<br />

<strong>The</strong> target disks, LINUX01 <strong>10</strong>0-<strong>10</strong>1, are linked multi-read (read/write if no other user ID has<br />

write access) as virtual devices 2<strong>10</strong>0 and 2<strong>10</strong>1:<br />

# vmcp link linux01 <strong>10</strong>0 2<strong>10</strong>0 mr<br />

# vmcp link linux01 <strong>10</strong>1 2<strong>10</strong>1 mr<br />

Copy the source to the target disk with FLASHCOPY<br />

<strong>The</strong> two disks are copied with the CP FLASHCOPY command:<br />

# vmcp flashcopy 1<strong>10</strong>0 0 end to 2<strong>10</strong>0 0 end<br />

Command complete: FLASHCOPY 1<strong>10</strong>0 0 END TO 2<strong>10</strong>0 0 END<br />

# vmcp flashcopy 1<strong>10</strong>1 0 end to 2<strong>10</strong>1 0 end<br />

Command complete: FLASHCOPY 1<strong>10</strong>1 0 END TO 2<strong>10</strong>1 0 END<br />

If you do not have the FLASHCOPY feature, see the next shaded box.<br />

148 <strong>The</strong> <strong>Virtualization</strong> <strong>Cookbook</strong> <strong>for</strong> RHEL 6

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!