Powered By Blogger

2014/08/25

Oracle VM for X86 / RHEL PVM Kickstart Installation without DHCP

Just a quick and short post to share a tip related to installation of RHEL as ParaVirtual Machine using kickstart(or any distribution that can use kickstart) on Oracle VM 3 for X86 without having to rely on a DHCP for the Network Parameters. The only prerequisite that is needed is to have kickstart file and RHEL Installation Path available on the network and reachable from Oracle VM Manager Server.
Once that's done, we create our Virtual Server as usual, except that for Network Path, we're having to add more parameters. Indeed we can use the --args to add any parameters we're willing to pass to the kernel. So, we're having something like :

--args kernel_boot_paramaters http://install_server/rhel6_4

For example, let's say that my kickstart file is located on an http server and accessible via http://install_server/my_kickstart.ks, I also need to set 192.169.0.10 as IP of eth1 interface in order to get access to this kickstart file's URL and the RHEL installation tree is http://install_server/rhel6_4. Then, i'll have the following:

--args "ks=http://install_server/my_kickstart.ks ip=192.169.0.10 ksdevice=eth1 netmask=255.255.255.0 gateway=192.169.0.1" http://install_server/rhel6_4






Note that the --args section are in quote, this is needed to clearly draw the boundary between what is kernel arguments and the installation tree's URL. 

2014/08/19

Ansible Hosts / Install alternate upgraded Python version

Following the highlighted error below which happened while trying to configure a RHEL4 node to be manageable by ansible (and that i rightly attributed to the old Python 2.3.4 which is the default version of Python for RHEL4), i've decided to install an alternate Python version on the same RHEL node without impacting the already existing environment. Below i'm sharing the 8 steps I followed to have that working.
Note that although i'm describing this Python Installation in  relation with Ansible Integration, Step 1 to Step 6 can be used for the installation of an alternate Python Environment on any other Linux Systems.

Ansible's Error:
[stivesso@ansible-server ~]$ ansible my_ansible_node -m ping  --ask-pass
SSH password:
my_ansible_node | FAILED >> {
    "failed": true,
    "msg": "\r\nSUDO-SUCCESS-josewbugtgyoijxrgkuxihoejbjsbiuq\r\n  File \"/home/esso_s/.ansible/tmp/ansible-tmp-1406122775.05-117998270117858/ping\", line 1177\r\n    clean_args = \" \".join(pipes.quote(arg) for arg in args)\r\n
     ^\r\nSyntaxError: invalid syntax\r\n", 
    "parsed": false
}


1. Install Prerequisites on the target host



2. Get an updated python package



3. Untar/unzip the package on the target node



4. configure with the alternate path as option (here, i'm planning to install the alternate environment in /opt/python2.7) and compile/install




5. Export Shared Library and Bin Library in PATH and LD_LIBRARY_PATH on User profile 



6. Create ld.so.conf configuration file and run ldconfig to have library loaded system wide



7. Add the following to /etc/ansible/hosts on the Ansible Control Machine for the target node

 

8. Test again the ping module from ansible-server...

2014/07/16

Linux KVM / Network Bridge over bonded Interface

This is a short post about KVM Network Bridge Configuration for Guest Domain over a bonded Interface. For this post, we're using a Redhat Enterprise Linux 6 as KVM Physical System, but the procedure can be easily adjusted for any others Linux System which supports KVM. Before delving in the Technical Configuration, let’s have a look on what we’re trying to achieve. We’re having a Physical Server with 02 Physical Interfaces (eth0 and eth1) and are planning to use these two physical Interfaces in a highly available configuration. The same interfaces are also used to support a bridge that is used by KVM DomU (Guest Hosts). Below, we can see a picture describing the details of this configuration.





The first thing to do is to complete the bonding configuration and that's pretty straightforward. We're just creating the bonding.conf file in /etc/modprobe.d (to dynamically load the bonding module, bonding's option  will be modified later on and must reflects ones' needs), then we're editing the ifcfg-bond0 network configuration files.


Let us now configure the bond0 Interface by editing its configuration files, note the BRIDGE configuration mentioned below, this is explicitly added to link the bond interface to the bridge interface. We are also setting the bond Interface parameters here.


Next thing to do is to configure the bridge Interface, as usual we’re creating the ifcfg-br0 file containing our network configuration (IP, DNS...). Note that as described above, this is the Interface that will have the IP settings used to administrate the Physical Server (Note that this is a matter of architecture/design, on a typical production server with four interfaces, we could have for example separated this management network from the Guest Domains Network...)



Finally, we can configure the physical interface and restart the network service (or reboot the node…)



Check the Bridge Configuration, should have output similar to the one below. The bridged interface is now ready to be used by the Guest Domains.

2014/02/03

P2V Migration From Solaris 10 Global Zone to Oracle Solaris 11 Local Zone (Solaris 10 Branded Zone)

The aim of this post is to describe a Physical to Virtual (P2V) migration of a Bare-Metal Solaris 10 (a Physical Node) on a Solaris 11 Global Zone (Solaris 10 Branded Zone on Oracle Solaris 11). The scenario describes below involves a Solaris 10 Physical node named oranode (hosts an Oracle Database 10G and another Oracle application) and a Solaris 11 Global Zone named sol11-gz (already hosting some other Local Zones). 
In order to make this migration easily understandable, It has been technically divided in in 03 parts, the first parts deals with Analysis of the Source System, the second is about System/Data Collection and the third is about Target Zone Configuration and Installation.

I. Analysis of the Source System


The Data Analysis phase aims to collect some initial analysis Data. Oracle has provided a very nice tool for that phase, namely zonep2vchk. zonep2vchk serves two functions. First, it can be used to report issues on the source which might prevent a successful p2v migration. Second, it can output a template zonecfg, which can be used to assist in configuring the non-global zone target (man page).
The /usr/sbin/zonep2vchk script is belonging to pkg:/system/zones on Solaris 11 and can be copied from an Oracle Solaris 11 system to an Oracle Solaris 10 system. It is not required to run this utility from a specific location on the system.
Below, we're copying this utility to our Solaris 10 (oranode) and then we're running it with the option -T S11 which specifies that the target node for our planned migration of this Solaris 10 System is running on Oracle Solaris 11.



Quite verbose! Indeed this initial analysis give us a lot of insights for the whole p2v procedure. For example, we can see that in this study case, we have much more than 01 ZFS Zpool (beside the initial rpool). These are File-system which host the Oracle Database 10G (mentioned above) Data Files.
Thus, we must decide how these  application Data's file-systems will be migrated. The strategy we're applying here is to migrate just the Operating System (excluding the Application Data File-System), and use SAN replication for the Application Data. Note that this decision is based on the source system architecture (we may for example decide to go for a zfs send/receive if these Data file-system are not located on an external storage…).

Once done with that, we complete this analysis phase by creating a template file for the Target Zone Creation (using the same zonep2vchk tool with the option -c). This is just a template , it is used to ease the creation of the target Zone and should be adjusted to suit with the requirement of the target environment.


II. System/Data Collection


This phase aims to collect Source System's Data (Solaris 10 System - oranode) and transferred them to the Target System (Solaris 11 Global Zone - s11-gz). As discussed during the analysis phase, I have decided to migrate System Data and Application Data in separate processes.
For the system, I’m making use of the classic flarcreate to generate system archive (due to the presence of Data File-System that i'd like to exclude, i'm using CPIO as method to archive the file). For the Application Data, they're being migrated using External Storage Cloning features (not described here!). 



The transfer of this archive to the target Global Zone can be done using any conventional method (scp/sftp/ftp, SAN Replication...). Once completed, we can move to the last part.

III. Target Zone Configuration and Installation


Now that we've the Data Collection phase completed, we’re going to create the target zone and start the restoration of the flararchive that was created. We’ll also add the Zpool Dataset which were migrated using the SAN replication features.
The zone will be created using the template that was generated by the zonep2vchk tool (we'll obviously customize it to fit the target environment). Before starting, we have to create the zonepath needed for the target zone and import the zpool that was migrated through the SAN replication.



Let’s now configure our new local zone by using the template generated by zonep2vchk tool during the first phase.



Having the configuration done, we can start the zone Installation



Finally, We are adding the ZFS dataset migrated through SAN Replication,



And the big moment! Boot the new zone...

2014/01/31

Oracle Solaris 11: EMC PowerPath / powermt display dev ; Device(s) not found.

This is just a small post about Oracle Solaris 11 and EMC PowerPath Configuration. If you've been trying to get EMC PowerPath configured on Solaris 11 and facing error(s) similar to the one below, then follow steps described below (can also follow the same for initial PowerPath Configuration on Oracle Solaris 11)




1. Make sure that Zoning/Lun Mapping from SAN/Storage is well configured.
For the zoning , run fcinfo remote-port -p <pwwn_connected_hba> (must list the PWWN and others details of the storage, otherwise must check that the zoning is well complete);
For the Storage Configuration, you can use fcinfo lu -v (list all fibre channel  logical  units, must have one or more "OS Device Name" listed here, otherwise must check that mapping is well done at the SAN Level). 




2. Check that Oracle Solaris mpxio is disabled.
That can easilly be achieved by running stmsboot with -L option.  If Solaris  I/O  multipathing  is not enabled, then no mappings are displayed. If It's enabled, then disable it by running "stmsboot -d". For example, below we can see the output with Solaris mpxio enabled (and the output printed when disabling -and the reboot required-).




3. Check that your storage's type is managed by EMC PowerPath
For that , we're using powermt with options display options. If our storage's type is listed as unmanaged (like the clariion below), then simply mark it as managed (using powermt manage as seen below) and you're done!





We should also pay attention to /kernel/drv/iscsi.conf. In fact, though Solaris  can distinguish between FC and iSCSI devices, some PowerPath versions don't make this distinction for manage and unmanage. So the mpxio-disable value must be set to yes in both the fp.conf (for fp.conf, it's also done automatically with stmsboot -d) and iscsi.conf files for PowerPath to manage EMC Clariion and VNX Storage Arrays.

2013/08/27

Oracle Virtual Machine Server 3.2 for X86 / VM Migration from OVM 2.2

That's a short post which aims to describe a v2v (virtual to virtual) migration of Oracle VM X86  from OVM 2.2 to OVM 3.2. I won't cover the installation of OVM 3.2 nor its configuration. I'll assume  that it's already done (with valid server pool/servers/storage repositories...).
Technically, the process involves archiving the source VM (on OVM 2.2), transfer this archive on a web server (thus making it available using http), import this archive as template on the destination environment (OVM 3.2) and create a new VM based on this template. I know it seems a bit cumbersome for a simple v2v, but that's how it worked for me. So, here we go.


1. Stop the source VM and archive its folder on OVM 2.2
The source directory are located under /OVS/.../running_pool on OVM2.2




2. Transfer this archive to a Web Server Folder (or to a FTP Server)
This web server must be accessible from the Target OVM 3.2 environment.



3. Import this archive as template under the destination OVM environment
This web server must be accessible from the Target OVM 3.2 environment.


For that, from the OVM 3.2 Console: Go to “Repositories” / “Choose the target repository” / “VM Templates” / "Click Import VM Templates" and add your internal webserver and file location http://stivesso.local/src_vm.tar.gz






4. When the import job is completed, just create a new VM based on this template


You can then power on the new VM...


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