Archive for the ‘SMF/ZFS/Zones’ Category

ZFS GUI

Tuesday, March 21st, 2006

If you’ve never seen the ZFS GUI you should check it out.. it’s pretty cool. It’s been available since SXCR b28 and supposed to be in Solaris 10 Update 2. To start up the web server:

# /usr/sbin/smcwebserver start

Then connect to through your browser to https://host:6789

You are greeted with a page like so:

ZFS login screen

You can login as root here.. and then you will the main:

ZFS main page

Click on ZFS and it brings up a page to admin all the ZFS goodies, it will have your pools and vdevs listed:

ZFS admin page

Here you can manage almost anything you can from the command line.. these guys definately did a badass job so far on this. A shot of it displaying a progress bar on how much I’ve used:

ZFS admin page

This just makes admin’ing ZFS even more simple.

Zone cloning

Sunday, March 19th, 2006

On my server at home, I use ZFS for my zone installations in /zones. When testing out the new zone cloning I got an error:

# time zoneadm -z ns2zone clone -m copy ns1zone
Cloning zonepath /zones/ns1zone…zoneadm: zone ‘ns2zone’: ‘copy’ failed with exit code 6.

The copy failed.

More information can be found in /var/log/zoneAAAjMaG4W

real 0m29.619s
user 0m0.477s
sys 0m10.709s

wow.. look how fast cloning works.

# more /var/log/zoneAAAjMaG4W
cpio: Cannot chown() “/zones/ns2zone/.zfs/snapshot”, errno 89, Operation not applicable
cpio: Unable to reset modification time for “snapshot”, errno 89, Operation not applicable
cpio: Cannot chmod() “/zones/ns2zone/.zfs/snapshot”, errno 89, Operation not applicable
cpio: Cannot chown() “/zones/ns2zone/.zfs”, errno 89, Operation not applicable
cpio: Unable to reset modification time for “.zfs”, errno 89, Operation not applicable
cpio: Cannot chmod() “/zones/ns2zone/.zfs”, errno 89, Operation not applicable
193840 blocks
6 error(s)

It’s having trouble copying some ZFS directory which shouldn’t be a big deal. So lets look at what state it’s in:

# zoneadm list -vc
ID NAME STATUS PATH
0 global running /
2 ldapzone running /zones/ldapzone
4 sunwebzone running /zones/sunwebzone
6 dhcpzone running /zones/dhcpzone
- ns1zone installed /zones/ns1zone
- ns2zone incomplete /zones/ns2zone

The workaround for this is to just edit /etc/zones/index and change the zone state for the zone to installed. It should now show installed:

# zoneadm list -vc
ID NAME STATUS PATH
0 global running /
2 ldapzone running /zones/ldapzone
4 sunwebzone running /zones/sunwebzone
6 dhcpzone running /zones/dhcpzone
- ns1zone installed /zones/ns1zone
- ns2zone installed /zones/ns2zone

Then proceed to boot the new zone and all is well.

BTW if you think that clone was fast, right now cloning is using cpio to copy the contents from one directory to another when cloning. They are working on making it where it uses snapshots to clone instead which will be even faster.

Solaris Boot Camp

Tuesday, January 31st, 2006

Well the Solaris Boot Camp came to Dallas and it was a very cool thing, and Bob is a cool guy and was nice to meet. Anyone that can cram that much information into that small amount of time deserves some respect. Some things I learned from Bob (and some I forgot about):

FMA features like fmadm, fmstat

  • boot -m milestone=milestone allows you to boot to a specific milestone
  • boot -m milestone=all boots all milestones
  • boot -m milestone=none which is useful in reparing a system that have problems booting early
  • boot -m verbose will print a line of information at boot when every service is started

    Change your default run level:
    (To change to another run-level just skip the -d part)

  • svcadm milestone -d milestone/single-user:default
  • svc:/milestone/single-user:default is runlevel S
  • svc:/milestone/multi-user:default is runlevel 2
  • svc:/milestone/multi-user-server:default is runlevel 3

    If you look at an FMRI entry:
    svc://localhost/network/login:rlogin
    notice the localhost part.. the word is eventually we’ll be able to use svc://someotherhost/network/login:rlogin

  • SMF service “unintialized” means that it didn’t start due to incomplete initialization (check sysidconfig, zlogin -C, NFS question)
  • SMF service “offline” means its tried to start but its dependencies weren’t met.
  • SMF service “disabled” means its off.
  • SMF service “maintenance” means error must be resolved by admin. check log.
  • SMF service “degraded” means its running at limited capacity in comparison to normal operation.

    Cool presentation Bob, and let me know when the Sun Developers Day comes.

  • Sun Java System Web VS Apache

    Monday, December 5th, 2005

    Some interesting results here.

    Machine: Dell Optiplex GX50 192MB ram
    Both were on ZFS filesystems, both were default installs with no tweaking.

    Sun Java System Web Server 6.1 SP5 (Sun ONE web 6.1) out performed Apache 1.3.33 over 50% in the 10000 and 50000 tests but failed miserably on the multiple requests tests. I think maybe because of the size of box I was using wasn’t enough for Sun ONE. I did tweak Sun ONE web to try and get better results but it wasn’t enough of a boost to come near to Apaches results. Also, I tried both of these on UFS and ZFS filesystems and didn’t see much of a difference. What was interesting was when the machine booted up with Apache running, I would run a test on Apache and see 100 requests per second, but if I shut Apache down then started it back up I would continuously get in the 200+ requests per second. I also tested Apache 2 default install and it didn’t come near to what Apache 1.3.33 was doing.

    – TEST #1 - Sending 10000 requests to each webserver.

    Sun Java System Web 6.1 SP5:
    # ./ab -n 10000 http://192.168.0.1/test.html

    Time taken for tests: 18.766986 seconds
    Complete requests: 10000
    Requests per second: 532.85 [#/sec] (mean)
    Time per request: 1.877 [ms] (mean)
    Time per request: 1.877 [ms] (mean, across all concurrent requests)
    Transfer rate: 115.47 [Kbytes/sec] received

    Apache 1.3.33:
    # ./ab -n 10000 http://192.168.0.2/test.html

    Time taken for tests: 41.324907 seconds
    Complete requests: 10000
    Requests per second: 241.98 [#/sec] (mean)
    Time per request: 4.132 [ms] (mean)
    Time per request: 4.132 [ms] (mean, across all concurrent requests)
    Transfer rate: 61.20 [Kbytes/sec] received

    – TEST #2 - Sending 50000 requests to each webserver.

    Sun Java System Web 6.1 SP5:
    # ./ab -n 50000 http://192.168.0.1/test.html

    Time taken for tests: 104.39602 seconds
    Complete requests: 50000
    Requests per second: 480.59 [#/sec] (mean)
    Time per request: 2.081 [ms] (mean)
    Time per request: 2.081 [ms] (mean, across all concurrent requests)
    Transfer rate: 104.18 [Kbytes/sec] received

    Apache 1.3.33:
    # ./ab -n 50000 http://192.168.0.2/test.html

    Time taken for tests: 211.475598 seconds
    Complete requests: 50000
    Requests per second: 236.43 [#/sec] (mean)
    Time per request: 4.230 [ms] (mean)
    Time per request: 4.230 [ms] (mean, across all concurrent requests)
    Transfer rate: 59.80 [Kbytes/sec] received

    – TEST #3 - Sending 700 requests with 50 multiple requests.

    Sun Java System Web 6.1 SP5:
    # ./ab -c 50 -n 700 http://192.168.0.1/test.html

    Time taken for tests: 303.792244 seconds
    Complete requests: 700
    Requests per second: 2.30 [#/sec] (mean)
    Time per request: 21699.445 [ms] (mean)
    Time per request: 433.989 [ms] (mean, across all concurrent requests)
    Transfer rate: 0.50 [Kbytes/sec] received

    Apache 1.3.33:
    # ./ab -c 50 -n 700 http://192.168.0.2/test.html

    Time taken for tests: 48.288760 seconds
    Complete requests: 700
    Requests per second: 14.50 [#/sec] (mean)
    Time per request: 3449.197 [ms] (mean)
    Time per request: 68.984 [ms] (mean, across all concurrent requests)
    Transfer rate: 3.67 [Kbytes/sec] received

    – TEST #4 - Sending 700 requests with 20 multiple requests.

    Sun Java System Web 6.1 SP5:
    # ./ab -c 20 -n 700 http://192.168.0.1/test.html

    Time taken for tests: 210.536258 seconds
    Complete requests: 700
    Requests per second: 3.32 [#/sec] (mean)
    Time per request: 6015.322 [ms] (mean)
    Time per request: 300.766 [ms] (mean, across all concurrent requests)
    Transfer rate: 0.72 [Kbytes/sec] received

    Apache 1.3.33:
    # ./ab -c 20 -n 700 http://192.168.0.2/test.html

    Time taken for tests: 6.209052 seconds
    Complete requests: 700
    Requests per second: 112.74 [#/sec] (mean)
    Time per request: 177.401 [ms] (mean)
    Time per request: 8.870 [ms] (mean, across all concurrent requests)
    Transfer rate: 28.51 [Kbytes/sec] received

    – TEST #5 - Sending 700 requests with 10 multiple requests.

    Sun Java System Web 6.1 SP5:
    # ./ab -c 10 -n 700 http://192.168.0.1/test.html

    Time taken for tests: 51.20231 seconds
    Complete requests: 100
    Requests per second: 1.96 [#/sec] (mean)
    Time per request: 5102.023 [ms] (mean)
    Time per request: 510.202 [ms] (mean, across all concurrent requests)
    Transfer rate: 0.41 [Kbytes/sec] received

    Apache 1.3.33:
    # ./ab -c 10 -n 700 http://192.168.0.2/test.html

    Time taken for tests: 0.170248 seconds
    Complete requests: 100
    Requests per second: 587.38 [#/sec] (mean)
    Time per request: 17.025 [ms] (mean)
    Time per request: 1.702 [ms] (mean, across all concurrent requests)
    Transfer rate: 146.84 [Kbytes/sec] received

    Using ZFS for zone backups/snapshots

    Monday, November 28th, 2005

    Using ZFS for temporary zone backups/snapshots works great
    and is quick and easy.

    Create a ZFS filesystem for zone1 and set its mountpoint

    # zfs create pool1/zones/zone1
    # zfs set mountpoint=/zones/zone1 pool1/zones/zone1

    Configure the zone and set its zonepath=/zones/zone1

    # zonecfg -z zone1
    yada yada..

    # zoneadm -z zone1 install
    # zoneadm -z zone1 boot
    # zlogin -C zone1

    yada yada..

    # zoneadm list -vc
    ID NAME STATUS PATH
    0 global running /
    3 zone1 running /zones/zone1

    Take a snapshot of the zone just as it is and call it ‘test’, nothing created inside the zone yet

    # zfs snapshot pool1/zones/zone1@test
    # zlogin zone1
    [Connected to zone 'zone1' pts/2]
    Last login: Mon Nov 28 14:35:20 on pts/1
    Sun Microsystems Inc. SunOS 5.11 snv_27 October 2007
    # ls
    bin etc home mnt opt proc system usr
    dev export lib net platform sbin tmp var

    Make files in the zone, we will revert back to the old without these here in a minute

    # mkfile 50m testfile
    # mkfile 100m testfile1
    # ls
    bin export mnt platform system tmp
    dev home net proc testfile usr
    etc lib opt sbin testfile1 var

    # exit
    # zonename
    global

    Now back in the global zone, lets rollback to the snapshot where it doesn’t have the testfile and testfile1

    # zfs rollback -r pool1/zones/zone1@test
    cannot umount '/zones': Device busy

    Oops! forgot to shut the zone down first

    # zoneadm -z zone1 halt
    # zfs rollback -r pool1/zones/zone1@test
    # zoneadm -z zone1 boot

    This whole rollback procedure took about 5 seconds
    Lets login to the zone and see if the files are gone and it rolled back successfully:

    # zlogin zone1
    [Connected to zone 'zone1' pts/2]
    Last login: Mon Nov 28 14:35:20 on pts/1
    Sun Microsystems Inc. SunOS 5.11 snv_27 October 2007
    # ls
    bin etc home mnt opt proc system usr
    dev export lib net platform sbin tmp var

    ZFS Cheatsheet

    Friday, November 4th, 2005

    For those of us outside of Sun:

    With ZFS on the way, I thought I’d gather up from some of my resources and create a ZFS cheatsheet so you can get ready for whats to come:

    There are two main commands for ZFS, “zfs” and “zpool”

    "zpool list" - Show current usage on zfs pools
    "zpool iostat 5" - Display I/O stats for zfs pools
    "zpool vdevs" - Shows current mirror/pool device properties
    "zpool create pool c0t3d0 c1t1d0 c4t4d0 c5t2d0" - Creates a pool consisting of c0t3d0 c1t1d0, c4t4d0, c5t2d0
    "zpool create -fv pool slice1 slice2" - Creates a pool consisting of slice1 and slice2
    "zpool create pool mirror c1t0d0 c2t0d0" - Creates a mirror consisting of c2t0d0 and c2t0d0
    "zpool add -f pool mirror c0t1d0s3 c0t1d0s4" - Adds mirror to pool

    "zfs list" - Show current zfs filesystems
    "zfs create pool/filesystem" - Creates filesystem under pool
    "zfs create pool/filesystem /mountpoint" - Creates filesystem under pool and mounts it to mountpoint
    "zfs snapshot pool/filesystem@snapshotname" - Takes snapshot of filesystem
    "zfs mount pool/filesystem /mountpoint" - Mounts a zfs filesystem to mountpoint
    "zfs destroy pool/filesystem" - Deletes filesystem from pool
    "zfs destroy pool" - Deletes pool

    Notes on ZFS:
    (From what I’ve gathered, may not be correct)

  • Package Name: SUNWzfs
  • You can’t convert a UFS filesystem to a ZFS filesystem as of yet, this means if you want ZFS you will have to install Solaris 10 Express from scratch.
  • If upgrading, ZFS can be used on new disks but not on existing UFS disks.
  • If there is a bad checksum on a disk, ZFS will grab the good checksum from another disk in the mirror and self heal.
  • You can use part of a pool for additional swap space.
  • Other operating systems can’t mount ZFS volumes as of yet.
  • There is never a need to fsck a ZFS filesystem.
  • Samba manifest and method

    Friday, October 21st, 2005

    Converted this a while ago.

    Snmpd and Snmpdx Manifest and Method

    Wednesday, October 19th, 2005

    I switched these over a while back and never thought to post it or that I might be able to get a free mug out of it. Here it is.

    Zone with Bind

    Monday, May 23rd, 2005

    I uploaded a file I did a long time ago that is a command outline of what all I did to get a zone running with bind. For those of you that don’t know what zones are, it is a virtual server inside your solaris machine. This is simliar to jails but zones go way beyond jails. Check out this.

    Solaris 10 PDFs

    Thursday, May 19th, 2005

    I was browsing some sites today and came across a few good pdfs on some of the new features in Solaris 10. I liked these because they had some information I haven’t read anywhere else and they also had some great examples and explanations.

    Zones
    SMF
    ZFS

    btw that whole mediacast.sun.com has other great information to browse through.