Solaris 10 Zones cloning


 
Thread Tools Search this Thread
Operating Systems Solaris Solaris 10 Zones cloning
# 1  
Old 10-29-2008
Solaris 10 Zones cloning

I have gone over some articles regarding zones, I haven't found one that gives the exact information I'm looking for. I think I'm close though.

I have 2 servers, each with a HBA into a SAN, they are both presented with the same luns.

On server1, configured and installed the zone (zone1), the zone sits in /SAN/zone_data/zone1

On server2, I want to be able to bring that zone up on that machine (not at the same time as server1 though). I'm presented with /SAN/zone_data/zone1. zone1 also has configuration options I would like to replicate/keep, for instance I have added a file system of /SAN/mydata to the zone.

Just wondering if this is the correct syntax to get the job done on server2 to get the other configuration options available. I've not seen an article referencing /etc/zones/zone1.xml just wondering if that needed to be moved also?

Hmm, does doing a detach copy the configuration into the zone (/SAN/zone_data/zone1) ?

# Migration/Copy of a zone
server2-global# zonecfg -z zone1
zonecfg:zone1> create -a /SAN/zone_data/zone1
zonecfg:zone1> exit

server2-global# zoneadm -z zone1 attach
server2-global# zoneadm -z zone1 boot
# 2  
Old 10-31-2008
The syntax for cloning a zone will be:
# zoneadm -z new-zone clone [-m method] method_params

Cloning a zone is analogous to installing a zone. That is, you first must configure the new zone using the zonecfg command. Once you have the new zone in the configured state you can use clone to set up the zone root instead of installing. This allows all
customizations (configuration, pkgs, etc.) from the source zone to be directly instantiated in the new zone. The new zone will be left in the sys-unconfigured state even though the source zone is likely to be fully configured. The source zone must be halted while the clone is running.

The zoneadm command will be enhanced to perform additional verification when cloning. Appropriate warnings and errors will be printed if the new zone and source zone are configured inappropriately.

The -m option specifies the method used to clone the source. The default and initial -m method will be “copy”. This will copy the data from the source zone (specified as the method_param) zonepath to the new-zone zonepath (implemented using cpio as with the move sub-command).
# 3  
Old 10-31-2008
Question worded incorrectly

Quote:
Originally Posted by incredible
The syntax for cloning a zone will be:
# zoneadm -z new-zone clone [-m method] method_params
Cloning a zone is analogous to installing a zone.
Hmm, very good information. I think I might have worded my question incorrectly.

I have two physically different machines, I have server A and server B which are both V210s that are connected to shared storage between the two.

I have configured on server A, the zone called zone1, which the files are located in /SAN/zone_data/zone1 which is the shared disk storage between A and B.

What I want to do is be able to issue a halt on zone1 on Server A, then issue a zone boot on server B to bring up zone1.

My question is, what do I have to do on Server B to configure the zone to run on B just like it is configured on A?

Both servers have identical Solaris 10 installations and same hardware specs.

Hopefully that makes a little more sense of what I'm trying to do, I'm sure it's pretty simple. I'll keep going over some more docs to see if I can't come up with something.
# 4  
Old 11-04-2008
Quote:
Originally Posted by beaker457
What I want to do is be able to issue a halt on zone1 on Server A, then issue a zone boot on server B to bring up zone1.
.
Why would you want to do this? The purpose?
And what I can see see it is as running the zones on HA cluster service, if not it would be wise to use a script to automate the "failover". It can be done
# 5  
Old 11-04-2008
Importing a configured zone?

Quote:
Originally Posted by incredible
Why would you want to do this? The purpose?
To answer your question, I have a need to have zone1 the exact same between server1 and server2 at any given time. I do plan on having the upping and downing the zone via a script that will take into account which host the zone is currently running on and which one it isn't on.

Server1 and Server2 both share a SAN share with zone1 data on it, how do I go about getting Server2 configured so that I can bring up zone1 on that host?

Also having this information will assist me if I ever have to restore the zone from back up if the host fails. It has to be fairly trivial to import a configured zone on to a new global zone host.

I may have just answered my own question, I'll have to look into importing a configured zone onto a new host. I would certainly like to hear more zone experience relating to failover, but if not I can continue to do my own research.

Thanks again,

Last edited by beaker457; 11-05-2008 at 05:16 PM..
# 6  
Old 11-06-2008
This is quite an interesting subject. We've been exploring our possibilities with this as well. You definitely want to look into the detach/attach mechanism. Cloning isn't useful here, since you don't need to "clone" any data, it's already on the SAN. What you're doing is actually "moving" a zone. Have you looked at this?

Solaris Operating System - Move a Solaris Containers How To Guide

However, I must say, if you want a true "redundancy" solution you'll be wanting some kind of other solution sooner or later. Maybe two zones that are constantly up, that share their application data on the SAN....? Eventually it's much better to put up some kind of cluster: either on application level (e.g. Weblogic cluster, Oracle RAC) or else on OS level (SUN cluster). Or on both levels, if you're so inclined.

That said, there are still options left to play with the idea of being able to boot a zone on another machine at any time. We've been wondering about this as well: If we have zones on a SAN volume, can we boot them on another server? Well, if you use the detach/attach mechanism, it will work. You'll just have to recreate the zone config (zonecfg) on the second machine.
One easy way to do this, is to export the config on machine A and import it on machine B. You could even store the config on the SAN. If the SAN volume is visible on both machines, you could do:

Code:
machinea# zonecfg -z zone1 export > /SAN/zone_configs/zone1
machinea# zoneadm -z zone1 detach

machineb# zonecfg -z zone1 -f /SAN/zone_configs/zone1
machineb# zoneadm -z zone1 attach
machineb# zoneadm -z zone1 boot

Voila. There isn't more to it than that. (Make sure both machines have the same patchlevel and the attach should work fine).

However, this is all great, IF you can do the detach/attach. If you use this as a redundancy option, when machine A crashes you won't be able to do the detach... Do you know if there's a way to an attach without the detach? We haven't tested it yet. Either way, I'd be interested in hearing about any solutions you've implemented.
# 7  
Old 11-25-2008
The procedure I've used to clone zones are as follows.

Procedure

1. Export the configuration of the zone you want to clone/copy

# zonecfg -z zone1 export > zone2.cfg

2. Change the details of the new zone that differ from the existing one (e.g. IP address, data set names, network interface etc.)

# vi zone2.cfg

3. Create a new (empty, unconfigured) zone in the usual manner based on this configuration file

# zonecfg -z zone2 -f zone2.cfg

4. Ensure that the zone you intend to clone/copy is not running

# zoneadm -z zone1 halt

5. Clone the existing zone

# zoneadm -z zone2 clone zone1
Cloning zonepath /export/zones/zone1...
This took around 5 minutes to clone a 1GB zone (see notes below)

6. Verify both zones are correctly installed

# zoneadm list -vi
ID NAME STATUS PATH
0 global running /
- zone1 installed /export/zones/zone1
- zone2 installed /export/zones/zone2

7. Boot the zones again (and reverify correct status)

# zoneadm -z zone1 boot
# zoneadm -z zone2 boot
# zoneadm list -vi
ID NAME STATUS PATH
0 global running /
5 zone1 running /export/zones/zone1
6 zone2 running /export/zones/zone2

8. Configure the new zone via its console (very important)

# zlogin -C zone2
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Solaris

Archiveadm system cloning - Solaris 11.4

Hi all, I am trying to use archiveadm to backup/clone an existing Solaris11.4 system. However, i failed at media creation with the error -> "Media can only be created from archives containing root-only data" root@xxx:/mnt/opt/software# zpool list NAME SIZE ALLOC FREE CAP DEDUP ... (6 Replies)
Discussion started by: javanoob
6 Replies

2. Solaris

Cloning RAID0 drives, Solaris 10u11

Hello all, this is my first time posting here. Where I work we have multiple servers (x3-2's) running Solaris 10u11 with 2 drives configured as RAID0, 300GB per. There are 4-6 open slots for drives to clone to. Past attempts to clone/backup these drives has failed. One of the machines is... (1 Reply)
Discussion started by: eprlsguy
1 Replies

3. Solaris

Migration of Solaris 10 on physical host to Solaris Zones

Hi All Kindly let me know how can I move Solaris 10 OS running update 10 on physical machine to another machine solaris zone running Solaris 10 update 11 (2 Replies)
Discussion started by: amity
2 Replies

4. Solaris

Cloning Solaris 10 with zones

Hello, What is the best method to use to clone a Solaris 10 machine with zones, to ensure all software and config can be easily installed on new hardware? Thank You (4 Replies)
Discussion started by: da2013
4 Replies

5. Solaris

Cloning Solaris 10 perdicament

Hello and let me say at first, thank you for viewing this problem I have. From the top! Where I work, we have a Dell PowerEdge T300 X86 system running Solaris 10 8/07 s10x_u4wos_12b X86, and we realized, if this machine went down, we would be in trouble. So to fix that situation, I took it... (5 Replies)
Discussion started by: nitrolinux
5 Replies

6. Solaris

Problems cloning Solaris 10 x86 Installation to bigger HDD

Dear All, I have been trying to move my existing Solaris Installation (x86, 10/08) to a bigger HDD. So I created a 22 cylinder boot partition and used the rest of the space for a Solaris2 partition. Then I created slices same size like on my current disk. I copied all files with cpio and... (3 Replies)
Discussion started by: BigT79
3 Replies

7. UNIX for Advanced & Expert Users

Cloning a solaris system

I have several Solaris 8,9 and 10 servers. I need to refresh them and avoid doing any OS upgrades. I may have to apply patches when I am done due to the new hardware. My current servers have internal disk and my new target servers (same processor types) will have only SAN storage. Once the... (0 Replies)
Discussion started by: zzqv9p
0 Replies

8. Solaris

Solaris Zones

Hi Every, I would like to know some questions on Zones??? 1.what are types of zones we can install in global zone??? 2.Exact difference between sparce root and whole root??? 3.can we change the ip address of a running zone??? 4.how to find our in which zone we are running and how many... (8 Replies)
Discussion started by: tirupathiraju_t
8 Replies

9. UNIX for Dummies Questions & Answers

Long Distance UNIX (Solaris) Cloning ?

Need some advice and guidance for this UNIX beginner. Due to downsizing I have inherited the SysAdmin duties..(sigh). Please excuse and forgive me if I use the wrong terms below.... Situation: We have UNIX ( Solaris 7/8/9( it varies) on Sun Ultra 10's) servers located at several global... (1 Reply)
Discussion started by: HikerLT
1 Replies
Login or Register to Ask a Question