2016년 4월 24일 일요일

Monitoring Cloudstack-Zenoss 4.2.5

1. System Requirement.
   OS:
Centos logo.png CentOS 64-bit 6.x (recommended)
  Hardware Requirements: Up to 1000 Devices

Deployment Size

Memory
CPU
Storage
 
1 to 250 devices
 
4GB
 
2 cores
 
1x300GB, 10K RPM drive or SSD
 250 to 500 devices 8GB 4 cores 1x300GB, 10K RPM drive or SSD
 500 to 1000 devices 16GB 8 cores 1x300GB, 15K RPM drive or SSD

Auto-deploy Installation

Bulbgraph.png Note: Updated for 4.2.5
The simplest way to install Zenoss Core 4.2 on a newly-deployed RHEL/CentOS 64-bit 5/6 system is to use our auto-deploy script, which downloads all required files for you. To use the script, first set up a new server running one of our supported operating systems. Then, as root, run the following commands:
# wget https://github.com/zenoss/core-autodeploy/tarball/4.2.5 -O auto.tar.gz
# tar xvf auto.tar.gz
# cd zenoss-core-autodeploy-*
Now, you have the option of editing zenpack_actions.txt, which defines all ZenPacks that will be installed by default (all Core ZenPacks). If you would like to avoid installing certain ZenPacks, then remove the corresponding lines from this file and save it.
Now you are ready to install Zenoss Core 4.2.5:
# ./core-autodeploy.sh

2016년 4월 18일 월요일

Start A Xen Server VM that Gives "VDI Not Available"

Recently,Xenserver was working abnormally.
During the reboot, the following messages are displayed and
Cold reboot was necessary.  After the cold reboot, some VMs are not started normally.

 File "/opt/xensource/sm/resetvdis.py", line 155, in ?
    reset_vdi(session, vdi_uuid, force)
  File "/opt/xensource/sm/resetvdis.py", line 56, in reset_vdi
    vdi_ref = session.xenapi.VDI.get_by_uuid(vdi_uuid)
  File "/usr/lib/python2.4/site-packages/XenAPI.py", line 245, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib/python2.4/site-packages/XenAPI.py", line 149, in xenapi_request
    result = _parse_result(getattr(self, methodname)(*full_params))
  File "/usr/lib/python2.4/site-packages/XenAPI.py", line 219, in _parse_result
    raise Failure(result['ErrorDescription'])
XenAPI.Failure: ['UUID_INVALID', 'VDI', '--force']



Furthermore, we also received the following error message when we tried to boot the server from the Xev Servers host's console:

[root@xenserver-102-90 log]# xe vm-start vm=vm-name
Error code: SR_BACKEND_FAILURE_46
Error parameters: , The VDI is not available [opterr=VDI 29ee8765-5556-42e1-a53e-362435f03d38 locked], 

 
To fix this issue , I followed the steps listed below   
1.
[root@]# xe vdi-forget uuid=29ee8765-5556-42e1-a53e-362435f03d38
2.

[root@}# xe vdi-list uuid=29ee8765-5556-42e1-a53e-362435f03d38
uuid ( RO)                : 29ee8765-5556-42e1-a53e-362435f03d38
          name-label ( RW): name
    name-description ( RW): name
             sr-uuid ( RO): dc7d9c04-bc32-cf68-d0c9-954a32257c55
        virtual-size ( RO): 322223484
            sharable ( RO): false
           read-only ( RO): false
3.
[root@]# xe vdi-param-set uuid=29ee8765-5556-42e1-a53e-362435f03d38 name-label=new-name

4.
[root@]# xe vdi-list uuid=29ee8765-5556-42e1-a53e-362435f03d38
uuid ( RO)                : 29ee8765-5556-42e1-a53e-362435f03d38
          name-label ( RW): new-name
    name-description ( RW): new-name
             sr-uuid ( RO): dc7d9c04-bc32-cf68-d0c9-954a32257c55
        virtual-size ( RO): 322122547200
            sharable ( RO): false
           read-only ( RO): false

5. On the VMs storage tab, select “Attach” and proceed to select the VDI on the SR.

2016년 2월 4일 목요일

P2V with XenServer

IBM 3250 M2 with 2003 Server to Virtual Machine.

Tools : Xenconverter 2.4
XenServer : 6.0

Migration Steps.

1. Run XenConverter
2. Modified the Disk Storage.
3. Select XenServer and type credential
4. Execute the Convert directly to XenServer.

If you want to Convert Windows 2012 R2 physical machine to Virtual Machine,
You need to use, XenConverter 2.5 x64 with XenServer 6.0.


2016년 1월 21일 목요일

How to Change the Pool Master



xe pool-emergency-transition-to-master
xe pool-designate-new-master host-uuid=
cat /etc/xensource/pool.conf

2016년 1월 18일 월요일

How to unhide a VM in XenServer?

To find the UUID of the hidden VM, type the following xe command:
xe vm-list
Make note of the UUID of the hidden VM.
b. To unhide the VM, type the following xe command:
xe vm-param-clear param-name=other-config uuid=<vm uuid> 

2016년 1월 12일 화요일

How to Set Locales (i18n) On a Linux or Unix

/etc/sysconfig/i18n

The /etc/sysconfig/i18n file sets the default language, any supported languages, and the default system font. For example:
LANG="en_US.UTF-8" 
SUPPORTED="en_US.UTF-8:en_US:en" 
SYSFONT="latarcyrheb-sun16"

2016년 1월 11일 월요일

How to Increase the size of CentOS 7 LVM by expanding the virtual machine disk



1. Identifying the partition type

As this method focuses on working with LVM, we will first confirm that our partition type is actually Linux LVM by running the below command.
fdisk -l

2. Increasing the virtual hard disk


3. Partition the new disk space

As outlined in my previous images the disk in my example that I am working with is /dev/sda, so we use fdisk to create a new primary partition to make use of the new expanded disk space. Note that we do not have 4 primary partitions already in place, making this method possible.
fdisk /dev/sda
We are now using fdisk to create a new partition, the inputs I have entered in are shown below in bold. Note that you can press ‘m’ to get a full listing of the fdisk commands.
‘n’ was selected for adding a new partition.
WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
         switch off the mode (command 'c') and change display units to
         sectors (command 'u').

Command (m for help): n
‘p’ is then selected as we are making a primary partition.
Command action
   l   logical (5 or over)
   p   primary partition (1-4)
p
As I already have /dev/sda1 and /dev/sda2 as shown in previous images, I have gone with using ‘3’ for this new partition which will be created as /dev/sda3
Partition number (1-4): 3
We just press enter twice above as by default the first and last cylinders of the unallocated space should be correct. After this the partition is then ready.
First cylinder (2611-3916, default 2611): "enter"
Using default value 2611
Last cylinder, +cylinders or +size{K,M,G} (2611-3916, default 3916): "enter"
Using default value 3916
‘t’ is selected to change to a partition’s system ID, in this case we change to ‘3’ which is the one we just created.
Command (m for help): t
Partition number (1-5): 3
The hex code ‘8e’ was entered as this is the code for a Linux LVM which is what we want this partition to be, as we will be joining it with the original /dev/sda5 Linux LVM.
Hex code (type L to list codes): 8e
Changed system type of partition 3 to 8e (Linux LVM)
‘w’ is used to write the table to disk and exit, basically all the changes that have been done will be saved and then you will be exited from fdisk.
Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks.
You will see a warning which basically means in order to use the new table with the changes a system reboot is required. If you can not see the new partition using “fdisk -l” you may be able to run “partprobe -s” to rescan the partitions. In my test I did not require either of those things at this stage (I do a reboot later on), straight after pressing ‘w’ in fdisk I was able to see the new /dev/sda3 partition of my 10gb of space as displayed in the below image.
For CentOS/RHEL run a “partx -a /dev/sda3” to avoid rebooting later on.
That’s all for partitioning, we now have a new partition which is making use of the previously unallocated disk space from the increase in VMware.

4. Increasing the logical volume

We use the pvcreate command which creates a physical volume for later use by the logical volume manager (LVM). In this case the physical volume will be our new /dev/sda3 partition.
root@Mega:~# pvcreate /dev/sda3
  Device /dev/sda3 not found (or ignored by filtering).
In order to get around this you can either reboot, or use partprobe/partx as previously mentioned to avoid a reboot, as in this instance the disk does not appear to be there correctly despite showing in “fdisk -l”. After a reboot or partprobe/partx use the same command which will succeed.
root@Mega:~# pvcreate /dev/sda3
  Physical volume "/dev/sda3" successfully created
Next we need to confirm the name of the current volume group using the vgdisplay command. The name will vary depending on your setup, for me it is the name of my test server. vgdisplay provides lots of information on the volume group, I have only shown the name and the current size of it for this example.
root@Mega:~# vgdisplay
  --- Volume group ---
  VG Name               Mega
...
VG Size               19.76 GiB
Now we extend the ‘Mega’ volume group by adding in the physical volume of /dev/sda3 which we created using the pvcreate command earlier.
root@Mega:~# vgextend Mega /dev/sda3
  Volume group "Mega" successfully extended
Using the pvscan command we scan all disks for physical volumes, this should confirm the original /dev/sda5 partition and the newly created physical volume /dev/sda3
root@Mega:~# pvscan
  PV /dev/sda5   VG Mega   lvm2 [19.76 GiB / 0    free]
  PV /dev/sda3   VG Mega   lvm2 [10.00 GiB / 10.00 GiB free]
  Total: 2 [29.75 GiB] / in use: 2 [29.75 GiB] / in no VG: 0 [0   ]
Next we need to increase the logical volume (rather than the physical volume) which basically means we will be taking our original logical volume and extending it over our new partition/physical volume of /dev/sda3.
Firstly confirm the name of the logical volume using lvdisplay. This name will vary depending on your setup.
root@Mega:~# lvdisplay
  --- Logical volume ---
  LV Name                /dev/Mega/root
The logical volume is then extended using the lvextend command.
root@Mega:~# lvextend /dev/Mega/root /dev/sda3
  Extending logical volume root to 28.90 GiB
  Logical volume root successfully resized
There is then one final step which is to resize the file system so that it can take advantage of this additional space, this is done using the resize2fs command for ext based file systems. Note that this may take some time to complete, it took about 30 seconds for my additional space.
root@Mega:~# resize2fs /dev/Mega/root
resize2fs 1.41.12 (17-May-2010)
Filesystem at /dev/Mega/root is mounted on /; on-line resizing required
old desc_blocks = 2, new_desc_blocks = 2
Performing an on-line resize of /dev/Mega/root to 7576576 (4k) blocks.
The filesystem on /dev/Mega/root is now 7576576 blocks long.
Alternatively if you’re running the XFS file system (default as of RedHat/CentOS 7) you can grow the file system with “xfs_growfs /dev/Mega/root”.
With this method we have increased the virtual disk drive through VMware, created a new partition out of this newly unallocated space within the guest OS, turned it into a physical volume, extended the volume group, and then finally extended the original logical volume over the newer physical volume resulting in overall disk space being increased successfully.