網頁

2014年11月30日 星期日

CentOS 7.0 --- Install Open VM Tools on Guest VM

When I install the WMware Tool on the fresh CentOS 7 minimal version, I get an error message about the bad interpreter /usr/bin/perl command so that the installer script cannot be executed.
ScreenHunter_438The reason is the minimal CentOS installation never installs the Perl package by default.

If the network function is normal, we can execute the yum install perl command to install it from Internet repository.ScreenHunter_449
Or we can install it from local CDROM so that need to mount the CDROM media at first.
ScreenHunter_439next to create a repository configuration file as cdrom.repo in /etc/yum.repos.d/ directory with the following content.
ScreenHunter_447Then use the yum --disablerepo=\* --enablerepo=c7-media install perl commandScreenHunter_448So do that the Perl package will be installed now.ScreenHunter_450
Although we can execute the vmware tools and no any error message as before, another question will show up that tell us the ifconfig command not found.
Next action? We will do another choice to install Open VM tools in CentOS 7 guest.

According to “Guest Operating System Installation Guide”, VMware recommends using the Open VM Tools redistributed by the operating system vendors.
Why?
Open VM Tools is the open source implementation of VMware Tools and consist of a suite of virtualization utilities that improves the functionality, administration, and management of virtual machines on VMware hypervisors.
How to do it?
Install open-vm-tools package (# 1)
Install open source vmware tools by using the yum install open-vm-tools command
ScreenHunter_461
Install open-vm-tools-deploypkg plug-in package (# 2)
Due to this VM will make as a template, we will install the deployPkg Tools plug-in.
At first, we will download all the VMware Public Packaging Public Keys from the http://packages.vmware.com/tools/keys directory by using the wget http://packages.vmware.com/tools/keys/VMWARE-PACKAGING-GPG-RSA-KEY.pub command.
ScreenHunter_465next to import the VMware packaging public keys by using the rpm --import VMWARE-PACKAGING-GPG-RSA-KEY.pub commandScreenHunter_466
we will create a repository configuration file as vmware-tools.repo in /etc/yum.repos.d/ directory with the following content.
ScreenHunter_462
Install deployPkg Tools plug-in by using the sudo yum install open-vm-tools-deploypkg commandScreenHunter_463
Reference
(# 1)   VMware support of open-vm-tools (2073803)
(# 2)   Installing the deployPkg plug-in in a Linux virtual machine (2075048)
(# 3)   We cannot install Open VM Tools and VMware Tools on the same Guest VM as follows.ScreenHunter_470

2014年11月16日 星期日

Ubuntu/Lubuntu --- How to free up /boot space

Today when I launch the software Updater and install the updated software on Lubuntu, the alert message tell me “Not enough free disk space” on disk /boot.ScreenHunter_410Even though I follow the suggestion to empty the trash an remove temporary packages by using the sudo apt-get clean command, the updated software still cannot be installed.

Thank friendly author to share the related knowledge on the Internet. Based on Google Search, I find out some information for me to resolve this problem. That is :
If the /boot partition size is full and the reason is the existing old kernel, maybe we will clean the old kernel images.
ScreenHunter_409
How to clear these old kernel images?
At first, we need to realize what the current kernel version is used by using the uname -r command.ScreenHunter_411next to list all the old kernels that we ever have installed it by using the dpkg -l linux-{image,headers}-"[0-9]*" | awk '/^ii/{ print $2}' | grep -v -e `uname -r | cut -f1,2 -d"-"` | grep -e '[0-9]' commandScreenHunter_412So do that we will know what version will be removed because the current kernel is not on these list.
Then we will begin to uninstall and delete these old kernel by using the dpkg -l linux-{image,headers}-"[0-9]*" | awk '/^ii/{ print $2}' | grep -v -e `uname -r | cut -f1,2 -d"-"` | grep -e '[0-9]' | xargs sudo apt-get -y purge commandScreenHunter_414After do it, the /boot space will be free up now.ScreenHunter_415

2014年10月26日 星期日

Microsoft Azure --- how to move VM from one cloud service to another


In the same Azure Subscription, each VM will build into a new cloud service if we create a new VM by taking the default set of options in the wizard. So do that we will reach the limit of 20 cloud service and the next new VM cannot be created besides apply for the request to Microsoft Cloud Help Desk.

“Whether VMs can move between different cloud services?” The following process will finish this thought.
Get the VM information by using the Get-AzureVM -servicename “<old cloud service name>” -name “<VM name>” command

擷取選取區域_001.jpg
Export this VM config by using the Export-AzureVM -ServiceName “<old cloud service name>” -name “<VM name>” -path “<.xml file>” command
擷取選取區域_002.jpg
Remove this VM from Azure but doesn’t delete the VHD file on disk (# 1) by using the Remove-AzureVM -ServiceName “<old cloud service name>” -Name “<VM name>” command
Edit the .xml file if we want to change local port number or Subnet Name for being compatible with the destination cloud service.
擷取選取區域_005.jpg
Ensure the current storage account is accessible by executing the Get-AzureSubscription command. If we find out the CurrentStorageAccount is blank, please choose what storage account this VMis in by using the set-AzureSubscription -SubscriptionName “<Azure Subscription>” -CurrentStorageAccount “<new Storage Account>” command. (# 2)
擷取選取區域_009.jpg
Import the VM config for creating this VM back to Azure by using the Import-AzureVM -path “<.xml file>” | New-AzureVM -ServiceName “<new cloud service name>” -VNetName “<virtual network name>” command.
擷取選取區域_011.jpg
So does that the VM has already been moved to another cloud service.
擷取選取區域_013.jpg

Reference :
(# 1)   Click on the Storage Icon on the left、select a storage account to open the Storage Main Page、click on the Containers tab and vhds item. We can see the removed VHD file in the list.
擷取選取區域_004.jpg
(# 2)   If the CurrentStorageAccountName is not defined, we will get the following error message when execute the Import-AzureVM powershell command.
擷取選取區域_006.jpg

2014年9月29日 星期一

Ubuntu/Lubuntu --- How to install & use iperf/jperf tool


About open source tool “iperf”, it is a best choice for measuring TCP/UPD bandwidth performance because it allow us to change TCP/UPD parameters and report bandwidth/Jitter diagram.
Due to “iperf” is command-line, we can add a graphical frontend tool “Jperf” or “XJperf” (develop on Google Code) after the “iperf” is installed so that the operation will be easy.

Install iperf
The easy way is using the sudo apt-get install iperf command or pre-compiled binary (# 1). So do that we will install the latest version of iperf.擷取選取區域_001.jpg 
Install XJperfDue to the Jperf require the Java version 1.5 or later, we have to verify whether the Java has already been installed on OS platform. If no exist, we can download & install the latest version from java.com Website.擷取選取區域_002.jpg
If it is ready, we will download the latest file jperf-2.0.2.zip from xjperf Google CodePage next to extract it to any location as /usr/local/src/ path. Then the jperf.sh script within the /usr/local/src/jperf-2.0.2/ directory have to set executable permission by running sudo chmod u+x jperf.sh  or  sudo chmod a+x jperf.sh command.擷取選取區域_003.jpg
So do that we can directly launch the application by executing ./jperf.sh command 擷取選取區域_005.jpg
and the Network performance measurement graphical tool will show up.擷取選取區域_004.jpg
Start Jperft Server roleDue to Jperf behavior is as a client/server application, we have to firstly start a Jperf server next to run a Jperf client on the network environment.
To start the Jperf server by selecting the Server radio button clicking the Run IPerf! button if we don’t want to change any the default setting as Jperf run in TCP mode or the listening port in 5001 and so on.擷取選取區域_006.jpg
So does that the Jperf Server role will be enabled and wait for Jperf client connection.擷取選取區域_007.jpg
Start Jperf Client roleTo launch the Jperf application in another machine, we have to select the Client radio button next to type the IP address of the Jperf server in the server address field. If we accept the default setting as Jperf will run a 10 second TCP test by using 1 stream, please click the Run IPerf! button to begin the test mechanism.擷取選取區域_009.jpg
When the iperf client send out testing data to the iperf server and the process end normally, we can see the related network report on this tool.
Jperft Server擷取選取區域_008.jpgJperft Client擷取選取區域_010.jpg

Reference:(# 1)   Iperf pre-compiled binary and information

2014年9月7日 星期日

Microsoft Azure --- how to move the machine from one to another subnet in the same region


If the Azaure VM locates on the wrong virtual network but on the same region, whether there is a method to move this VM from bad to right Subnet?
擷取選取區域_012.jpg
Yes, we can do it!
To log in to Azure subscription by executing the Add-AzureAccount powershell command. if the authentication is successful, we will collect some information for the VM will be moved later.
What information do we want to get? It will be the Cloud Service Name and VM Name by using the Get-AzureVM powershell command.
擷取選取區域_012.jpg
So do that we will know the maz-dc-05 VM belong to the xxx02 ServiceName.
At first, we will shutdown this VM by using the Start-Azure -ServiceName “Cloud Service Name” -Name “VM Name” powershell command.
擷取選取區域_011.jpg
And realize the original Subnet Name is “Subnet-FrontEnd” by executing the following command.
擷取選取區域_008.jpg
To move a VM to another subnet by using the Start-Azure -ServiceName “Cloud Service Name” -Name “VM Name” | Set-AzureSubnet –SubnetNames “the destination Subnet Name” | Update-AzureVM powershell command
擷取選取區域_009.jpg
So does that the VM has already been on the “Subnet-DMZ” now.
擷取選取區域_011.jpg

Reference:
(# 1). Move a VM or Role Instance to a Different Subnet

2014年8月21日 星期四

Microsoft Azure --- Install & Configure the Azure Cross-Platform Command-Line on Ubuntu (Lubuntu)

I know we can set static IP on Azure VM IaaS by using the Azure PowerShell on windows platform, but I want to do the same action on my Linux workstation. Based on this reason, I refer to the Microsoft Azure Web Site and find out there is the Azure cross-platform command line as the PowerShell. So I study the related information and write down the related procedure as follows:

Install Node.js with NPM
At first, we will add the Launchpad PPA to Lubuntu 14.04 by executing the sudo add-apt-repository ppa:chris-lea/node.js command.ScreenHunter_380To downloads the package lists from the repositories and "updates" them to get information on the newest versions of packages and their dependencies by using the sudo apt-get update command.ScreenHunter_381After adding the required PPA file and updating package lists, we will install Node.js with NPM package by running the sudo apt-get install nodejs command.ScreenHunter_383
Check Node.js and NPM version
To make sure that Node.js and NPM package are installed normally by typing the node --version commandScreenHunter_387and npm -v command
ScreenHunter_388
Install Azure Cross-Platform Command-Line Interface
Refer to the related document at this Microsoft URL http://azure.microsoft.com/en-us/documentation/articles/xplat-cli/ , we will install it by using the sudo npm install azure-cli -g command.ScreenHunter_389
Connect to the Azure subscription
To configure the xplat-cli to work with the Azure subscription, we have to firstly connect to the Azure subscription.
How to do it? The simple method is the organization account login to the Azure.
The login method only work with organizational account. If we are using a Microsoft account to login to the Azure subscription, we have to create a new user on Azure Active Directory so that this new user will be an organizational account.

Create an organizational account
If the default directory has already exist, we will directly create a new user by clicking ADD USER on Active Directory.ScreenHunter_390Due to we will create a new user belongs to the organization account, please select New user in your organization in TYPE OF USER and key in name in USER NAME.ScreenHunter_391In user profile dialog, we will key in some information as FIRST NAME, LAST NAME, DISPLAY NAME and select the User Role.ScreenHunter_392By clicking create button, the system will assign a temporary password for the organization user.ScreenHunter_393Please supply a legal email address for receiving this temporary password.ScreenHunter_394So does that the organizational account will be created now.ScreenHunter_395
Delegate Co-administrator role
In the management portal, select SETTINGS, Administrators and click Add button.ScreenHunter_397To key in the organization account with email address next to select one subscription.ScreenHunter_398So does that the organizational account can manage this Azure subscription now.ScreenHunter_399
Change password
At first, we have to change temporary password by clicking the hyperlink from mail or directly login to the Azure portal by using the organizational account.

So does that the system will redirect to another page for changing the password.ScreenHunter_402If the change process is successful, we can login to the Azure system now.
ScreenHunter_404
Execute the command line
After finishing the above method, we will login using an organizational account by using the azure login command.ScreenHunter_406
To log out the Azure, we can execute the azure logout command as follows:ScreenHunter_408
As to what functionality of this tool will be provided, we can refer to the Azure Official Web Site as this URL
http://azure.microsoft.com/en-us/documentation/articles/command-line-tools/

Although refer to this URL, I still don’t know how to set Static IP from Ubuntu. Maybe there is this function in the future, I guess.

Reference :
Due to npm now come with pre-packaged with Node.js ,we will get the error message if install it individually.
ScreenHunter_385
Since 2010 Design by Davidwa
©Copyright Davidwa Inc. All rights reserved.