Category Archives: vDirector 5.1

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

the operation failed because no suitable resource was found

Today i faced a stupid issue about vCloud Director, problem is i can not start vm and getting an error ‘the operation failed because no suitable resource was found’

Because of i was up until 03:00 am to 7:00 , really i couldn’t read a community long stories and targeted first search result of google 🙂
http://www.vmware.com/support/vcd/doc/rel_notes_vcloud_director_51.html

OVF template creation and media upload operations sometimes fail on organization vDCs backed by datastore clusters
Sometimes, when you attempt to upload media or create an OVF template on an organization that is backed by a datastore cluster, the operation fails. This occurs when the datastore cluster threshold has been exceeded. In the case of OVF template creation, the error message that displays is misleading, as it states that “The operation failed because no suitable resource was found.”

I’m not using datastore cluster but focused warnings on my datastores and one of the datastore disk threshold was yellow which vm was there , i increased  the LUN size from storage and vCenter, i’m not sure but reconnected the vCenter to vCloud Director and start it .

Result is working, hope do not face such issue but if problem is like mine then you have a solution and of course need to upgrade latest version but a note vCloud Directore become soo problemeatic this days …

VM

vCloud Directore Datastore Recognize Issue

A newly added datastores are not looks like assigned to provider and usage info is N/A.

Screen Shot 2013-02-08 at 6.42.01 PM

Reconnect vCenter and refresh storage profiles , unmount and mount datastore , disable and enable datastore do not help us

With support we did the fallowings

Backup the vCloud Director sql database

stop the cells

Execute such sql commends
delete from dbo.cluster_compute_resource_inv;
delete from dbo.compute_resource_inv;
delete from dbo.custom_field_manager_inv;
delete from dbo.datacenter_inv;
delete from  dbo.datacenter_network_inv;
delete from dbo.datastore_inv;
delete from dbo.datastore_profile_inv
delete from  dbo.dv_portgroup_inv;
delete from dbo.dv_switch_inv;
delete from dbo.folder_inv;
delete from dbo.managed_server_inv;
delete from dbo.managed_server_datastore_inv;
delete from dbo.managed_server_network_inv;
delete from dbo.network_inv;
delete from dbo.resource_pool_inv;
delete from dbo.storage_pod_inv;
delete from dbo.storage_profile_inv;
delete from dbo.task_inv;
delete from dbo.vm_inv;
delete from dbo.property_map;

DELETE FROM qrtz_simple_triggers;
DELETE FROM qrtz_fired_triggers;
DELETE FROM qrtz_cron_triggers;
DELETE FROM qrtz_job_listeners;
DELETE FROM qrtz_scheduler_state;
DELETE FROM qrtz_blob_triggers;
DELETE FROM qrtz_paused_trigger_grps;
DELETE FROM qrtz_triggers;
DELETE FROM qrtz_job_details;

start the cells

reconnect to vCenter from vCloud Director

and hope all problem has gone !

VM

vCloud Director Auto Password Generation and SID Change bug/change at provisioning time ..

Hello….

After upgrade vCloud Director, there is an issue about Windows VM provisioning about SID change and password reset

Issue is on version 1.5 SID and password reset –> allow local administrator password option default selected but after upgrade this options come unchecked and you have to manually set it before power on the vm if you need it

Look Change SID and Allow local administrator password check box and

VM

vCloud Director 5.1.1 is coming

All vCloud Providers

Version 5.1.1 is coming very soon

Also vShield Manager and other products updates are coming too !

I guess it will be available in a month …

VM

vDirector 5.1 sql upgrade failing

Yesterday we saw that not to much people upgraded their vCloud environment to 5.1

We hanged on step 2.0.34. it has a very funny when you heard that the problem , Problem is mem_overhead column.
At the upgrade time sql upgrade script create some temporary tables and this temp tables columns type of  mem_overhead is “int” but real world active running persistent tables mem_overhead is bigint and this cause vDirector upgrade problem …

Solution

First, restore the old db , select the values from vm_in table and find out something more then nine digits

select * from vm_inv where mem_overhead=3968430080

Replace it with any nine digits like below

update  vm_inv set mem_overhead=396843008  where mem_overhead=3968430080

VMware Support answer us like below 

I just got confirmation from engineering team that the memory_overhead_mb column in computevm table, it is deleted later in the upgrade script. So we don’t need to worry about about if this int type will cause any further issue with vCD5.1.
The workaround we discussed( just change the int to bigint), it should also work.And since the column is deleted at the end of upgrade, so we also don’t need to worry the type change has some downside in the future.

Hope no body need this article, but if you needed then you have a solution.

Note to all, always do tests with real data on test environment maybe still you can not see something but still you have chance to catch it !

VM

Full Error is Below ;

2012-10-01 19:34:06,380 | INFO | main | UpgradeAgent | Executing upgrade task: Upgrade to 2.0.34 |
2012-10-01 19:34:06,381 | DEBUG | pool-1-thread-1 | LoggingProgressListener | Upgrade Task Received progress report: com.vmware.vcloud.progress.ImmutableProgressReport@65f4be12 {state: RUNNING, progress: 0%} |
2012-10-01 19:34:06,383 | DEBUG | pool-1-thread-1 | LoggingProgressListener | Upgrade Task Received progress report: com.vmware.vcloud.progress.ImmutableProgressReport@65f4bfa5 {state: RUNNING, progress: 13%} |
2012-10-01 19:34:06,384 | DEBUG | pool-1-thread-1 | SerialAggregateTask | Steps to upgrade to 2.0.34: Beginning execution of task Record version 2.0.33.transition |
2012-10-01 19:34:06,427 | DEBUG | pool-1-thread-1 | SerialAggregateTask | Steps to upgrade to 2.0.34: Beginning execution of task Compute.groovy:22 |
2012-10-01 19:34:06,427 | DEBUG | pool-1-thread-1 | RawSQLTask | Executing sql ‘INSERT INTO computevm (id, computehub_id, vrp_id, creation_status, memory_min_mb,
memory_configured_mb, memory_overhead_mb, cpu_min_mhz, num_vcpu, vmmoref)
SELECT distinct vm.id, vrprp.computehub_id, vrp.id,
0,
vminv.mem_reservation, vminv.mem, vminv.mem_overhead,
vminv.cpu_reservation, vminv.vcpu_count,
vm.moref
FROM vm vm, vm_inv vminv, vapp_vm vappvm,
vrp vrp, vrp_rp vrprp,
vm_container vmcont,
org_prov_vdc o, org_prov_vdc_rp orp
WHERE vm.moref = vminv.moref
AND vm.vc_id = vminv.vc_id
AND vm.id NOT IN (SELECT vm_id FROM deployed_vm)
AND vm.id = vappvm.svm_id
AND vappvm.vapp_id = vmcont.sg_id
AND vmcont.org_vdc_id = o.id
AND o.id = orp.org_prov_vdc_id
AND orp.rp_moref = vrprp.sub_rp_moref
AND orp.vc_id=vrprp.sub_rp_vc_id
AND vrp.id = vrprp.vrp_id
AND vminv.resource_pool_moref = vrprp.sub_rp_moref’ |
2012-10-01 19:34:06,861 | WARN | pool-1-thread-1 | SerialAggregateTask | Steps to upgrade to 2.0.34: Task failed due to uncaught exception |
java.sql.DataTruncation: Data truncation
at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:382)
at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2816)
at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2254)
at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:631)
at net.sourceforge.jtds.jdbc.JtdsStatement.processResults(JtdsStatement.java:584)
at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQL(JtdsStatement.java:546)
at net.sourceforge.jtds.jdbc.JtdsStatement.executeImpl(JtdsStatement.java:723)
at net.sourceforge.jtds.jdbc.JtdsStatement.execute(JtdsStatement.java:1157)
at com.vmware.vcloud.upgrade.tasks.RawSQLTask.call(RawSQLTask.java:106)
at com.vmware.vcloud.upgrade.tasks.RawSQLTask.call(RawSQLTask.java:1)
at com.vmware.vcloud.upgrade.SerialAggregateTask.call(SerialAggregateTask.java:43)
at com.vmware.vcloud.upgrade.SerialAggregateTask.call(SerialAggregateTask.java:1)
at com.vmware.vcloud.upgrade.AbstractDelegatingTask.doCall(AbstractDelegatingTask.java:124)
at com.vmware.vcloud.upgrade.TransactionTask.doCall(TransactionTask.java:74)
at com.vmware.vcloud.upgrade.AbstractDelegatingTask.call(AbstractDelegatingTask.java:103)
at com.vmware.vcloud.upgrade.AbstractDelegatingTask.call(AbstractDelegatingTask.java:1)
at com.vmware.vcloud.upgrade.AbstractDelegatingTask.doCall(AbstractDelegatingTask.java:124)

at com.vmware.vcloud.upgrade.UpgradeTask.doCall(UpgradeTask.java:79)
at com.vmware.vcloud.upgrade.AbstractDelegatingTask.call(AbstractDelegatingTask.java:103)
at com.vmware.vcloud.upgrade.AbstractDelegatingTask.call(AbstractDelegatingTask.java:1)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
2012-10-01 19:34:06,862 | DEBUG | pool-1-thread-1 | RawSQLTask | Transaction for task ‘com.vmware.vcloud.upgrade.SerialAggregateTask@3a97263f’ will rollback |
java.sql.DataTruncation: Data truncation
at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:382)
at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2816)
at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2254)
at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:631)
at net.sourceforge.jtds.jdbc.JtdsStatement.processResults(JtdsStatement.java:584)
at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQL(JtdsStatement.java:546)
at net.sourceforge.jtds.jdbc.JtdsStatement.executeImpl(JtdsStatement.java:723)
at net.sourceforge.jtds.jdbc.JtdsStatement.execute(JtdsStatement.java:1157)
at com.vmware.vcloud.upgrade.tasks.RawSQLTask.call(RawSQLTask.java:106)
at com.vmware.vcloud.upgrade.tasks.RawSQLTask.call(RawSQLTask.java:1)
at com.vmware.vcloud.upgrade.SerialAggregateTask.call(SerialAggregateTask.java:43)
at com.vmware.vcloud.upgrade.SerialAggregateTask.call(SerialAggregateTask.java:1)
at com.vmware.vcloud.upgrade.AbstractDelegatingTask.doCall(AbstractDelegatingTask.java:124)
at com.vmware.vcloud.upgrade.TransactionTask.doCall(TransactionTask.java:74)
at com.vmware.vcloud.upgrade.AbstractDelegatingTask.call(AbstractDelegatingTask.java:103)
at com.vmware.vcloud.upgrade.AbstractDelegatingTask.call(AbstractDelegatingTask.java:1)
at com.vmware.vcloud.upgrade.AbstractDelegatingTask.doCall(AbstractDelegatingTask.java:124)
at com.vmware.vcloud.upgrade.UpgradeTask.doCall(UpgradeTask.java:79)
at com.vmware.vcloud.upgrade.AbstractDelegatingTask.call(AbstractDelegatingTask.java:103)
at com.vmware.vcloud.upgrade.AbstractDelegatingTask.call(AbstractDelegatingTask.java:1)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
2012-10-01 19:34:06,864 | DEBUG | pool-1-thread-1 | LoggingProgressListener | Upgrade Task Received progress report: com.vmware.vcloud.progress.ImmutableProgressReport@702d32f8 {state: FAILED, progress: 13%} |
2012-10-01 19:34:06,866 | ERROR | main | UpgradeAgent | Unable to upgrade the database: java.sql.DataTruncation: Data truncation |
com.vmware.vcloud.upgrade.UpgradeAgentException: java.sql.DataTruncation: Data truncation
at com.vmware.vcloud.upgrade.UpgradeAgent.runUpgradeTasks(UpgradeAgent.java:1219)
at com.vmware.vcloud.upgrade.UpgradeAgent.executeUpgrade(UpgradeAgent.java:745)
at com.vmware.vcloud.upgrade.UpgradeAgent.start(UpgradeAgent.java:979)
at com.vmware.vcloud.upgrade.UpgradeAgent.main(UpgradeAgent.java:881)
Caused by: java.sql.DataTruncation: Data truncation
at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:382)
at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2816)
at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2254)
at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:631)
at net.sourceforge.jtds.jdbc.JtdsStatement.processResults(JtdsStatement.java:584

at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQL(JtdsStatement.java:546)
at net.sourceforge.jtds.jdbc.JtdsStatement.executeImpl(JtdsStatement.java:723)
at net.sourceforge.jtds.jdbc.JtdsStatement.execute(JtdsStatement.java:1157)
at com.vmware.vcloud.upgrade.tasks.RawSQLTask.call(RawSQLTask.java:106)
at com.vmware.vcloud.upgrade.tasks.RawSQLTask.call(RawSQLTask.java:1)
at com.vmware.vcloud.upgrade.SerialAggregateTask.call(SerialAggregateTask.java:43)
at com.vmware.vcloud.upgrade.SerialAggregateTask.call(SerialAggregateTask.java:1)
at com.vmware.vcloud.upgrade.AbstractDelegatingTask.doCall(AbstractDelegatingTask.java:124)
at com.vmware.vcloud.upgrade.TransactionTask.doCall(TransactionTask.java:74)
at com.vmware.vcloud.upgrade.AbstractDelegatingTask.call(AbstractDelegatingTask.java:103)
at com.vmware.vcloud.upgrade.AbstractDelegatingTask.call(AbstractDelegatingTask.java:1)
at com.vmware.vcloud.upgrade.AbstractDelegatingTask.doCall(AbstractDelegatingTask.java:124)
at com.vmware.vcloud.upgrade.UpgradeTask.doCall(UpgradeTask.java:79)
at com.vmware.vcloud.upgrade.AbstractDelegatingTask.call(AbstractDelegatingTask.java:103)
at com.vmware.vcloud.upgrade.AbstractDelegatingTask.call(AbstractDelegatingTask.java:1)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

Upgrade vDirector,vShield Manager

This documentation is explaining upgrade vDirector 1.5 to 5.1 and vShield Manager 5.0-473791 to 5.1.0-807847 .

Next you have to upgrade vCenter,ESXi and other components, if you need instruction pls check the link. (Upgrading vCenter ,ESXi ,vShield are not must its working with vDirector 5.1 one but for full functionality and capability you have to upgrade all)

I expect that you are using vShield Manager 5.0 and above because under 5.0 version SQL upgrade will be canceled

Download vmware-vcloud-director-5.1.0-810718.bin (Upgrade File) andVMware-vShield-Manager-upgrade-bundle-5.1.0-807847.tar.gz (Upgrade File) my.vmware.com

To understand really what was changed, i advise you to get screenshots and create procedures how you are working on vDirector, then create something on version 5.1 and compare everychange very easy.
Shortly you couldn’t see any more Organization Networks on Manage & Monitor screen , Edge Gateways will be on newly , Storage Profile and Datastore Cluster will be appear newly 😀

Be aware about your vShield Edges, a new concept “compact” and “full” is available, shortly full have more ram then compact and support multiple interface 😀 which we are waiting for a long time also HA now available means you have redundant firewall now and don’t worry that alignment  of this VMs if you have enough host, DRS care about where place the HA vShield Edges.

Pls care about whats change about Organization Network changed vDC network, Nat rules changed Edge Gateway Rules.

We was waiting vShield Edge become more usable because old version have no CIDR entry, no Load Balancer , no DNAT, no HA but it has now, right time to use it but if you have a vShield firewalls soory 😦 you have to upgrade all pls read the instruction from  upgrade section of 5.1 installation pdf, which link is below.

I advise you to read the documentation one time http://pubs.vmware.com/vcd-51/topic/com.vmware.ICbase/PDF/vcd_51_install.pdf to understand whats is changed and steps for other explanations , but i can say that this article %100 cover the upgrade and succeeded %100

Step 1  : Upgrade vDirector

Check the status of vDirector, what it is doing any job running on it
./cell-management-tool -u vDirector_admin_user -p vDirector_admin_user_pass cell –status

Stop the new process entry , just only allow to processed already submitted requests
./cell-management-tool -u administrator -p Pa55w0rd cell –quiesce true

Check status until queue down to 0 and then execute command below to stop the cell
./cell-management-tool -u administrator -p Pa55w0rd cell –shutdown

for me cell could not stop quickly, you have to wait little , or stop the vcd service without execute such commands

First give executable right and execute the installation

chmod u+x vmware-vcloud-director-5.1.0-810718.bin
./vmware-vcloud-director-5.1.0-810718.bin

Upgrade SQL server

/opt/vmware/vcloud-director/bin/upgrade

Step 2 : Upgrade vShield Manager

Login vShield Manager and upgrade it from Settings & Report –> Updates  –> Upload Settings and upload the file you downloaded from my.vmware.com

 

Click install and fallow upgrade …..

 

 

Installation will reboot the vShield Manager VM wait until see the such line , then you can connect new manager

 

Upgrade vCenter Inventory, Server , vSphere Clients ,ESXi and others like syslog, web client, if need  help, pls check the link

Continue to configure vShiled Manager, need to integrate vCenter Server with it and configure ntp which vmware advse to have SSO server and vShield manager actually all components working together need to be same i thing ….

Pls Edit lookup Service , vCenter Server, DNS and ntp and configure it with your credentials …

 

 

After upgrade over, upgrade  vDirector agent, but be careful its need switch node maintenance mode , means need to move all VMs  between nodes until you update all nodes , pls see below

 

 

After that hope everything over fine , test your service creations and new features …..

VM