Powered By Blogger

2013/06/20

Linux System Recovery using Symantec Netbackup and a Linux Live-CD


The aim here is to describe a Linux System Recovery using Linux Live-CD and Symantec Netbackup Backup. Before delving into technical details, we want to highlight the fact that Symantec Netbackup has a Bare Metal Recovery features that suit this type of Recovery. But this feature doesn’t support all Linux OS (most of the popular ones are supported). For instance, this procedure was used to restored a complete Redhat 9 :)  Installation (it can also be used for a P2V migration).

Let’s check what is required for such restoration.

1.   A valid Full Symantec Netbackup Backup of the system we're trying to restore(I guess that one is obvious)
2.   A Linux Live CD that can support Symantec Netbackup Client, we’re using Ubuntu 8.04 LTS in this guide (fully supported, a list of supported OS can be found here)
3.  The installation CD of the Distribution we’re restoring, as stated above, we’re restoring a Redhat 9. So a Redhat 9 Boot CD is what we need for this case. The main reason for having the Install CD of the distribution is to avoid some incompatibility (like creating a filesystem which isn’t supported by the maintenance tools –e.g fsck- of the restored system)
4.  An Internet Connection (though it isn’t mandatory, we may just need some softwares/packages to install before installing Symantec Netbackup Client)

Once these prerequisites are met, we’re ready to start our restoration. As already described above, for this post, we’re using Ubuntu 8.04 LTS as Live-CD and are restoring a Redhat 9 Installation (the procedure can be easily adapted to others Distribution).

Below, a step-by-step (from a to f) description

a.     Boot on the Redhat 9 CD in rescue mode (linux rescue at the prompt) and recreate the target filesystems (the ones which will contain the restored data). Below is what we’ll create during this step.

MountPoint
Size
Filesystem
Device
/
65 GB
Ext3
/dev/sda3
/boot
100 MB
Ext3
/dev/sda1
/var
65 GB
Ext3
/dev/sda2
Swap
10 GB
Swap
/dev/sda5

Note that the target filesystems could be re-sized during this step (as long as we give enough space for the restoration). It’s also important to create these filesystems using the operating system we’re going to restore (avoid some filesystems features incompatibilities).

We just need a shell at this stage, so we’ll choose skip during the step in the screenshot below.



The filesystems are then created using fdisk and mkfs.ext3, mkswap… (as usual)


b.     Reboot the system on the Ubuntu Live-CD and install the required software for Netbackup Client Installation.
I assume that the network connectivity for Internet Connection and Software Installation is done for the Ubuntu LiveCD System. The list of software required to install on Netbackup Client for Supported Ubuntu/Debian can be found here. For proper NetBackup client operation on Ubuntu 8.04 Server Edition (64bit) the following packages are needed:

-  ia32-libs (In Universe Repository, so universe repository was enabled)
-  xinetd
-  ssh-server/rsh-server (required for remote install only)

We’ve also added the following for our specific environment

-  nfs-common (required to mount the directory where we’re keeping Netbackup Client binaries)
-  autofs (use to automatically mount the NFS shares)



Let’s also configured autofs to use /net automount features and complete Netbackup Client Installation.



c.     After the prerequisites, we’re adding Netbackup servers entries to the /etc/hosts files, add the Ubuntu Client Entries in Netbackup Servers hosts file, Install the client and register the Ubuntu LiveCD node.


On Ubuntu LiveCD,









On Master/Media Netbackup Servers,








d.     We can now mount the filesystems that were previously created (step a.) in the directory where we’ll push the restoration







e.     Let’s the restoration begin (using Netbackup Java Console, specifying as source the system to restore and as destination our Ubuntu Server, choose “restore everything to different location” and fill with the name of the directory where / is mounted)







Choose the last full you want to recover from the backup history and start the / restoration.











Uncheck  the rename soft/hard link options that are enabled by default.




f.      After the restoration, we can reboot the system and fix the Specific Operating Systems Issues that will arise. In this case, we’ve to do the following:



1.     Reinstall the Grub, for that we’re going through the “linux rescue” using Redhat 9 CD. We’ll let the rescue mode trying to mount the restored system under /mnt/sysimage. If not able, mount the filesystem manually and chroot under the mounted directory




2.     Modify the /etc/modules.conf to add Vmware scsi controller driver by replacing the following in /etc/modules.conf

# alias scsi_hostadapter mptbase
# alias scsi_hostadapter1 mptscsih


3.     Recreate the initrd which will now have the correct scsi modules



4.     I found that my etc/fstab was set to use e2label , so label were well reassigned to each filesystem

2013/04/25

Migration : From Solaris 10 Sparse Local Zone to Solaris 11 Local Zone

Let's described the migration process of Solaris 10 Sparse Local Zone to Solaris 11 Local Zone in 09 easy steps. But before delving into the subject, it's important to remind the following. 
In Solaris 10, we had 02 types of zones/containers that we could create, the first (and the default type) is "Sparse root zone" and the second is "Whole root zone". 
The main difference between these 02 types was that with "sparse root zone", you shared part of the root filesystem with the global zone while with  "whole root zone", every Solaris packages are copied to the local zone private filesystem. In Solaris 11, this distinction goes away (more details about Comparison between Solaris 11 Zone and Solaris 10 Zone can be found here). What we address below is the migration of a sparse Solaris 10 zone from Solaris 10 Global Zone to Solaris 11 Global Zone.

1. Let’s Print the existing zone's configuration. We will need this information to recreate the zone on the destination system:




2. The next step is to stop this source local zone and bring it to a state where it can be archived.
The reason for stopping the zone is that we should not archive a running zone because the application or system data within the zone might be captured in an inconsistent state.Also,  the zone is a sparse root zone that has inherit-pkg-dir settings, For that reason we need to bring it in the state "ready" ( that'll enable the archiving of  inherited directories).



3. Now, we should copy the /var/sadm/system/admin/INST_RELEASE from the source global zone to the source local zone, otherwise we may face the  Bug 15751945 (with an error stating that The image release version must be 10 (got unknown), the zone is not usable on this system).




4. Let’s archived the local zone (zonepath: /zpool_slz/slz).  For that we’ll create a gzip compressed cpio archive named Source_local_zone.cpio.gz (The local zone will still be named Source_local_zone on the target system)




N.B: the –c option of cpio is to avoid the error similar to “UID or GID are too large to fit in the selected header format”



5. Transfer the archive to the target Oracle Solaris 11.1 system, using any file transfer mechanism to copy the file, we’ll use sftp here.




6. On the target systems (DEST_GLOBAL_ZONE), create the target zone. Below, we're using a configuration file that's sourced for the creation of the zone.
Note – The zone's brand must be solaris10 and the zone cannot use any inherit-pkg-dir settings, even if the original zone was configured as a sparse root zone.




7. Display the new local zone's configuration:




8. Install the zone from the archive that was created on the source system, with the archive transferred into the /zpool_slz directory on the destination system




N.B: Again, you might get an error here specifying that “The image release version must be 10 (got unknown)” if you haven’t copied the /var/sadm/system/admin/INST_RELEASE file in the source local zone as specified above.



9. Once the zone installation has completed successfully, the zone is ready to boot.




Migration Completed....

2012/11/05

Solaris 11 REPO - Configuration of Multiple Repositories Using Multiple Depot Server Instances


As part of the exercise to install some virtualized highly available infrastructures using Oracle Solaris Technologies (Solaris Cluster, Solaris Zones, Solaris LDOMs…), I started by configuring and installing a Solaris 11  local IPS repository server. In this post, we’ll address the topic of installing an http shared repository for Solaris 11.1, Solaris Cluster 4.1 and EMC PowerPath.

As prerequisite for this configuration we need a working Solaris 11 System (can be either an x86-based or a SPARC-based system) with enough space available to copy the repositories (15Gb for Oracle Solaris 11.1 release repository and about 500 Mb for Oracle Solaris Cluster 4.0 and EMC PowerPath)

1.        Oracle Solaris 11.1 IPS Repository

There’s 02 ways to obtain a copy of the Oracle Solaris 11.1 IPS package repository: the first is to download the repository images files from the Oracle Solaris 11 download site and the second is to retrieve the repository directly from the Internet (using pkgrecv). We’ll go for the first method.
We’ll first create a zfs dataset for the package repository and disable the atime of this dataset (to improve performance during the update of this repo).

Then, concatenate the iso files downloaded , validate the download using digest and mount it

Synchronize the content of the repo directory by using rsync (pay attention to the / at the end of repo) and unmount the lofi device (optionally delete the iso files)


To enable clients to search for packages in the local repository, we’ll use the following command ( catalogs packages in the repository and updates search indexes).


At this stage, the repository is in place and can be used locally. But, in order to enable clients to retrieve packages in this local repository, we’ll configure an HTTP interface (also possible by using NFS Share). We’re using pkg.depotd to serve the repository to clients. Pkg.depotd (svc:/application/pkg/server) is the depot server for the image packaging system. It provides network access to the data contained within a package repository. By default, pkg.depotd listens for connections on port 80. For this Solaris Repository, we’ll use port 8080.


First of all, let’s make sure the publisher prefix is set on the ha-cluster repository:


If not, then let’s do it


To enable clients to access the local repository via HTTP, let’s configure and enable the svc:/application/pkg/server Service Management Facility (SMF) service.


Check and Browse the repository at http://<reposerver_ip_address>:8080/.



Now we can configure our repository on client system by resetting the origin for the Solaris publisher.
We first check the actual solaris publisher which is configured for the client node (by default it’s the oracle public repository).


We can reset the origin of this Solaris Publisher by running



2.       Oracle Solaris Cluster 4.1

Let’s now configure a second instance for the pkg.depotd (svc:/application/pkg/server)which will serve Oracle Solaris Cluster 4.1 Packages. The iso is downloaded from  OTN.



Again, the repository creation commands do not build a search index by default. To enable clients to search for packages in the local repository, we’ll use the following command  (catalogs packages in the repository and updates search indexes).



As described above, the repository for Solaris 11.1 is already configured using an http interface (pkg.depotd daemon handling the web service) So we’re going to serve multiple repositories using multiple pkg.depotd daemons running on different ports on the same repository server.  As we used port 8080 for Solaris 11.1 Repository, we’ll use 8081 for Solaris Cluster 4.1 Repository
Let’s make sure that the publisher prefix is set on the ha-cluster repository:



Add a new instance of the pkg/server service:


Complete configuration of the new pkg/server instance:


Start the new service:


Check and Browse the repository at http://<reposerver_ip_address>:8081/.


Configure the Solaris Cluster Repository on The client


3.       EMC PowerPath

For EMC PowerPath, the Archive was downloaded from EMC PowerLink and uncompressed.
Below are the steps to configure its repository.


To enable clients to search for packages in the local repository



As described above, the repositories for Solaris 11.1 and Solaris Cluster 4.1 are already configured using an http interface (pkg.depotd daemon handling the web service) So we’re going to add a third instance of pkg.depotd.  As we’ used port 8080 for Solaris 11.1 Repository and 8081 for Solaris Cluster 4.1, we’ll use 8082 for EMC PowerPath. Let’s check the publisher prefix of this new repository.


Add a new instance of the pkg/server service:


Complete configuration of the new pkg/server instance:


Start the new service:


Check and Browse the repository at http://<reposerver_ip_address>:8082/.


Configure the EMC PowerPath Repository on The client


Install EMC PowerPath Package




2012/02/07

HP ILO/Linux output to VSP

The aim here is to describe the configuration and usage of HP ILO VSP (Virtual Serial Port) in order to redirect a RHEL5 System Output on this Virtual Port.
Note that the procedure is different for RHEL6/Upstart or RHEL7/Systemd, these entries address the same for: RHEL6/Upstart based-System , RHEL7/Systemd based-system
The same procedure could be used with others Init-based Linux Distribution. We'll go through the following Steps:

BIOS Configuration
Grub Configuration
Init Configuration
Connect trough ILO

1. BIOS Configuration:

Go to ‘BIOS Serial Console & EMS’ menu
Set  ‘BIOS Serial Console Port’ to COM2
Set ‘BIOS Serial Console Baud Rate’ to 115200






























2. Grub Configuration:

Before modifying the grub.conf, we should first confirm the name of COM2 device which was previously configured in the BIOS. Setserial is a program designed to set and/or report the configuration information associated with a serial port. This information includes what I/O port and IRQ a particular serial port is using.



Append "console=tty0 console=ttyS1,115200" to the kernel configuration of your boot entry in grub.conf.



3. Init Configuration:

Add the following lines to /etc/inittab



getty / agetty - agetty opens a tty port, prompts for a login name and invokes the /bin/login command.

Ask Init Daemon to reread its configuration file



4. Connect trough ILO:

Now, it's time to try to connect.



If the Virtual Port is already in use by someone else, you'll have the following error: "Virtual Serial Port is currently in use by another session." In this case, you can stop the actual connection and start yours.