Monthly Archives: November 2013

Change The Storage Profile of vCloud Director Organisations vApps VMs with PowerCLI

Just only one level of storage profile change available in vCloud Director, its VM level and via GUI you have to change step by step every VM.

No way to change it vApp level , Organisation level or Provider level

From Matt Vogt blog find a script but can’t success and debug it, end of the day find that script do not turn href value. I do not have enough knowledge about PowerShell and other thing but start to learn about it.

href is link , show the path of thing you want to play. The link below indicate one of the storage profile GUID
Href            : https://v.dorukcloud.com/api/admin/extension/pvdcStorageProfile/1e38cfc5-079b-45ab-a185-c4e0ec1b45c8

This is the script what we run on our environment (Version 1)

Before execute the script you have to connect vCloud Director like below

Connect-CIServer -Server v.dorukcloud.com -User ‘your_user_name’ -Password ‘your_password’

Then continue the script

# Get vApp, Storage Profile from client
# Script will wait your input to get it

$vappName = read-host “vApp name”
$profileName = read-host “Storage Profile”

# Change each VM’s Storage Profile in the vApp
# Take the output of Get-CIVApp command and set the CIvApp variable

$CIvApp = Get-CIVApp $vappName

#Because of multiple VM can be inside vApp, we are going into loop
Foreach ($CIVM in ($CIvApp | Get-CIVM))

{
#Extensiondata help to dive vCenter SDK
$newSettings = $CIVM.extensiondata
$newSettings.storageprofile.name = “$profileName”

#Just only changing the profile name is not enough , you have to update the storage profile link below before Update the server data. Here i set it manually but you get it automatically.
#Here you should not forget that related storage profile need to be set under organisation vDC if not then you can not set it.
$newSettings.storageprofile.Href=”https://xxx.your_url.com/api/admin/vdcStorageProfile/78382381-a56f-4cea-b3eb-ee28abe07f87″

Write-Host “Changing the storage profile for $CIVM to $profileName”
#And start the extion , you will see that there is a migration task will be kicked on venter which make a storage change.
$newSettings.UpdateServerData()
}

a

This is the script what we run on our environment (Version 2)

# Script V2
# This script find out required Storage Profile from vDC Storage Profile list
# Related SP name requested from client # If related SP not available warn you, how? If there is no href catched then looks like there is no match what you enter as a SP name

$HREF = $NULL

# Get vApp, Storage Profile and OrgvDC names

$vDCName = read-host “vDC name”
$vappName = read-host “vApp name”
$profileName = read-host “Storage Profile”

# Change each VM’s Storage Profile in the vApp

$VDCSP = Get-OrgVdc -Name $vDCName
$VDCSP = $VDCSP.ExtensionData.VdcStorageProfiles
$VDCSP = $VDCSP.VdcStorageProfile

# This loop turn you the HREF of SP which name is “XivTunafishPerformance”
# You can use variable here of you want. In this script manually described.

for ($i=0;$i -le $VDCSP.Length -1;$i++)
{
write-host ” existing storage profile ” $vdcsp[$i].Name -foregroundcolor red -backgroundcolor yellow

if ($vdcsp[$i].Name -eq “XivTunafishPerformance”)
{
write-host “XivTunafishPerformance u buldum ”
$HREF = $vdcsp[$i].Href
break
}
}

if ($HREF -eq $NULL)
{
Write-host “Looks like there is no storage profile set on org vdc”
break
}
ELSE
{
$CIvApp = Get-CIVApp $vappName

Foreach ($CIVM in ($CIvApp | Get-CIVM))
{
$newSettings = $CIVM.extensiondata
$newSettings.storageprofile.name = “$profileName”
$newSettings.storageprofile.Href = “$HREF”
Write-Host “Changing the storage profile for $CIVM to $profileName”
$newSettings.UpdateServerData()
}
}

Thanks Matt
VM

Without vhd-util no way to start Cloudstack with Citrix XenServer Hypervisor

We are using Citrix XenServer with Cloudstack and it was first time to installation.

After installation over we saw that at the startup Cloudstack is deploying two system VMs one is console proxy (CP) other is secondary storage VM (SSVM) but this installations never over , until solve the problem its almost 200 deployment request generated by system.

if you choose the Citrix XenServer as a hypervisor , you should have vhd-util to run everything well. Looks like its used on every bit of vhd process like snapshot,create,check bla bla

Two problems we have , first is which vhd-util because when you connect hypervisor via cli there is already vhd-util there ? and second where we have to put.

First question answer ;  You have to download it from here http://download.cloud.com.s3.amazonaws.com/tools/vhd-util this is described here https://issues.apache.org/jira/browse/CLOUDSTACK-134

Second question answer ; You have to put vhd-util on each Citrix XenServer hypervisor under /opt/xensource/bin/ folder

After this two things everything is start to work quite well.

Have a fun with Cloudstack and Citrix XenServer
Subscribe cloudstack user mailing list
VM

Lets start Cloudstack …

I’m newly start to interest with Cloudstack , mostly using vCloud Director and SCVMM for manage vSphere and Hyper-v environment and very old Xen user but completely far a way what happened and what is it right now !

Now with my colleague Mehmet Mart, trying to apply/create same environments what we are offering now

I would like to create some articles because docs are sometimes not explain every bits, something absent and not so much people blogging(sorry, of course find someone but its not too much like vmware or microsoft) about it but mailing list is okay, you can find out answers and some companies are looks like fallowing the lists and answer you and have an offerings about design , support like shapeblue

Lets start Cloudstack

VM