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.

























2015년 12월 14일 월요일

Amazon to Launch Cloud Data Center in Korea



Amazon’s announcement, which the company’s chief cloud evangelist Jeff Barr made in a blog post Wednesday, is yet another example of US-based cloud giants going aggressively after Asia’s rapidly growing cloud services market.
Other recent examples are IBM’s deal with Chinese data center provider 21Vianet to provide its Bluemix Platform-as-a-Service to customers in China and the launch of IBM’s first SoftLayer data center in India. Microsoft launched three cloud data centers in India earlier this year.
Asian cloud service providers are expanding data center capacity in the region too. Chinese e-commerce and cloud giant Alibaba recently brought online a new data center in the Zhejiang Province.
Barr listed existing Korean customers that will be able to take advantage of Amazon’s new cloud data center capacity when it comes online. They include startups, gaming companies, and enterprises, the latter category including the electronics giant Samsung.
“These customers (and many others) have asked us for a local region,” Barr wrote. “We are looking forward to making it available to them and to many other enterprises, startups, partners, government agencies, and educators in Korea.”

http://www.datacenterknowledge.com/archives/2015/11/05/amazon-to-launch-cloud-data-center-in-korea/

Dedicated Servers

2015년 12월 7일 월요일

Amazon brings Microsoft users into AWS with Active Directory service


 Netdedi


Amazon has launched an AWS Directory Service for Active Directory, a fully managed implementation of Microsoft's authentication and user management service.
Using Active Directory in Amazon's cloud will enable companies to bring applications including SQL Server, SharePoint and custom applications built with .NET onto AWS. That's useful for businesses trying to move into the cloud from an on-premises deployment of Microsoft's software. 
When companies start using the service, it creates a pair of domain controllers connected to a user's virtual private cloud running Windows Server 2012 R2. Each domain controller runs in a different availability zone of a user's choosing inside a single region, and Amazon will handle the nuts-and-bolts of managing things like host monitoring, data replication and snapshots.
Administrators will be able to configure a trust relationship between their on-premises Active Directory and the AD in Amazon's cloud, so that users can sign in to both systems using one login. 


Companies can try the service for free for one month or 750 hours, whichever comes first. After that, the service costs US$0.40 per hour. 
It's an interesting move for Amazon, since one of the key products Microsoft uses to push its cloud services into large enterprises is Azure Active Directory -- a fully managed, cloud-based implementation of Microsoft's authentication and user management service with a whole bunch of other services and integrations baked in. It's an easy way to get one part of a business into Azure, which Microsoft can then use to try and upsell companies on other cloud services. 
How Amazon plans to expand this service to better compete against Azure AD remains to be seen, especially as it continues to fight with Microsoft to pursue dominance in the public cloud market.

2015년 11월 26일 목요일

My Local Probe is constantly "disconnected". What can I do?

Change Mac Scan Setting

By default, on services startup, PRTG tries to detect all available network adapters on the system running a probe (this includes, for example, the PRTG core server).
On few systems, this might lead to an exception so that the probe cannot fully connect to the core server. In this case, please try to disable the initial detection of available network cards.
Caution: Please backup your system before manipulating the Windows registry!

Step 1

  • On the system running the PRTG core server, open the registry editor.
  • For a 64-Bit Windows system, go toHKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Paessler\PRTG Network Monitor\Probe\
  • For a 32-Bit Windows system, go toHKEY_LOCAL_MACHINE\SOFTWARE\Paessler\PRTG Network Monitor\Probe\
Note: For PRTG 8 you might see the values in the additional sub-key V7 or V8.

Step 2

  • Add a new DWORD value with the name NoMacScan.
  • Set this to 1 to disable the initial search for network adapters.

2015년 11월 23일 월요일

Top 5 Web Hosting Talk Threads – Nov. 20, 2015



Every week our colleagues at Web Hosting Talk compile the top 5 most popular forum threads. Want to join in the conversation? Leave your thoughts in the comments and visitWeb Hosting Talk to sign up and learn more.
Is Shared hosting secure and safe?
Is shared hosting a good option for an ecommerce site? A small seller and new WHT member wants to know what type of hosting to use on a budget.
How risky is hosting from cheap hosting?
This WHTer wants to know the risks associated with hosting plans that cost $5 or $10 per year. Do you have any exerpience with extremely cheap hosting and insights you can share?
How can we start selling cloud hosting
In this thread a WHT member wants to know how to start selling cloud hosting and whether there is any such thing as a cloud dedicated server.
Someone offered to buy my domain (is it legit?)
A WHTer is looking for some advice around an offer on his domain that may be too good to be true.
Chargeback ~ How do you respond?
How do hosting companies respond toPayPal when customers look for chargeback? That’s the question in this WHT thread, still hot from last week.

2015년 11월 22일 일요일

Virtual Machine in XenServer Will Not Shut Down or Start; Stuck/Frozen Starting/Stopping


Virtual Machine in XenServer Will Not Shut Down or Start; Stuck/Frozen Starting/Stopping

If you’ve worked with XenServer for any length of time, you have no doubt experienced having a VM turn “orange” or “amber” or otherwise become unmanageable.  Here are couple of similar problem scenarios and solutions that might help.

Problem Scenario #1:
You notice that a VM has numerous lifecycle events on a XenServer.  It has continuously attempted to shutdown, but remains in the green/on state.  The VM will not display a console, or POST information.   Manual shutdowns in XenCenter do not work (Shutdown or Force Shutdown).
Solution:
You may have success trying some of these ideas, or it may take a combination of these to obtain control of the stuck VM.
  1. Start by trying an ‘xe-toolstack-restart’ on the pool master server.   This is the easiest fix, and will work a majority of the time.   You will lose connection to your pool momentarily.  If this doesn't work, go onto the next steps listed below.
  2. If this is a XenDesktop hosted VM, put the VM in maintenance mode, if you cannot force a Start/Shutdown from the DDC
  3. From the XenServer console, try the following command to force a shutdown:  ‘xe vm-shutdown –force vm=VMNAME’.  If VM does not shutdown with this command, proceed to next step
  4. In XenCenter, once the above two items are done, attempt to "Reboot" the VM. It may restart now.
Related Issue:
I experienced a similar issue where all members were down in a XenServer pool, but the pool Master remained up and functional.  The 'toolstack' processes were not running on pool members. An ‘xe-toolstack-restart’ was required on each pool member XenServer before the server would appear functional and participate in the XenServer Pool.

Problem Scenario #2:
This is the most common scenario you will see.  A virtual machine will go into an “amber” or “orange” state and you are unable to shutdown, reboot, or even forcefully reset the VM.

Solution:
  1. Find the UUID of the hung VM.
    You can do this via the command line with ‘xe vm-list’ or via XenCenter.
  2. Find the Domain ID of the hung VM.
    Run ‘list_domains’ from the command line, and match the UUID with the ID number
  3.  
    id |                                 uuid |  state
    0  | 2fe455fe-3185-4abc-bff6-a3e9a04680b0 |    R
    47 | 267227f3-a59e-dafe-b183-82210cf51ec4 |    B
    59 | 298817fb-8a3e-7501-11e0-045a8aa860ff |    B
    60 | 46e3d5aa-2f02-dfdc-b053-9a8ac56ec5d1 |    B
    61 | 16cf3204-eb17-5a12-e8d0-c72087bda690 |    B
    62 | 1f9053b5-c6ca-40bb-504e-3017c37e7281 |    H
    63 | ddaec491-097a-e271-362b-f2f985e26e4a |    R
    65 | 55f3b225-4f65-d1ea-aa19-add44c5acce7 |    B
    66 | 7adef6fd-9171-5426-b333-6fb1b57b8e60 |    B H
    67 | 6046dc13-f70b-8398-56fb-069c22440a7c |    B
    68 | f201cd94-a501-00c2-d21e-8c2f03ea167b |    B H
  4. Run destroy_domain on the Domain ID.
     
    # /opt/xensource/debug/destroy_domain -domid 62
  5. The VM will still show itself as running, so now, we need to reboot it.
     
    # xe vm-reboot name-label='name of the VM' –force
  6. The VM is now rebooted, and you can bring it up as if you had just pulled the plug.  That is, check for some disk corruption, etc.