Move vAPP between orgVDC fails and leaves VMs and disks separated
search cancel

Move vAPP between orgVDC fails and leaves VMs and disks separated

book

Article ID: 378882

calendar_today

Updated On:

Products

VMware Cloud Director

Issue/Introduction

  • Try to move a vAPP between orgVDCs fails with error: "failed to update and has been rolled back. The operation failed because no suitable resource was found"
  • New vapp is created and some VMs move inside VCD
  • Independent disks attached remain associated with old orgVDC
  • On vcenter VMs remain associated with old resource pool

Environment

vcloud director 10.3.3.2

vcenter server 7

Resolution


    • Move entire vapp from source resource pool to destination (inside vcenter)

    • Move vapp from source folder to destination (vm & templates view on vcenter)

    • Take note of url values for source and destination RP (From url bar on browser while selecting the objects on vcenter)

    • Inspect on db information for old and new orgvdc:


vcloud=# select * from org_prov_vdc where name in ('OLD_OVDC','NEW_OVDC');



    •  Example:


old id= AAAA-AAAA-AAAA-AAAA-AAAAAA


old resource pool= resgroup-1


new id= BBBBB-BBBB-BBBB-BBBB-BBBBBBB


new resource pool= resgroup-2



    • Rename carefully the entries for the affected VMs:


vcloud=# update logical_disk set org_vdc_id='BBBBB-BBBB-BBBB-BBBB-BBBBBBB' where org_vdc_id ='AAAA-AAAA-AAAA-AAAA-AAAAAA' AND name LIKE '%NAME_OF_DISK%' and logical_disk_type='DISK';    


UPDATE 83


Notes: this command updates entries based on name and type. It is recommended to update values based on something unique to exclude the possibility of making a mistake. Before running a delete or update statement, try first a select to confirm that the query returns only the correct values to be edited/deleted.



    • Check the Storage Policy information from the named disks:


vcloud=# select storage_class_id from ldisk_storage_class_join where logical_disk_id in (select id from logical_disk where org_vdc_id ='BBBBB-BBBB-BBBB-BBBB-BBBBBBB' AND name LIKE '%NAME_OF_DISK%' and logical_disk_type='DISK');



    • Example:


ID of new SP:CCCCC-CCCC-CCCC-CCCC-CCCCCCC


Currently ID:DDDDD-DDDD-DDDD-DDDD-DDDDDD



    • Replace SP id for all affected disks:


vcloud=# update ldisk_storage_class_join set storage_class_id='CCCCC-CCCC-CCCC-CCCC-CCCCCCC' where logical_disk_id in (select id from logical_disk where org_vdc_id ='BBBBB-BBBB-BBBB-BBBB-BBBBBBB' AND name LIKE '%NAME_OF_DISK%' and logical_disk_type='DISK');


UPDATE 83



    • List all VMs inside vapp:


vcloud=# select cvm_id,svm_id,vapp_id from vapp_vm where svm_id in (select id from vm where name like '%NAME_OF_DISK%');


VM EEEEE-EEEE-EEEE-EEEE-EEEEE is not inside vapp FFFFF-FFFF-FFFF-FFFF-FFFFF like it should but inside GGGGG-GGGG-GGGG-GGGG-GGGGG 



    • Update vm and move it to correct vapp:


 vcloud=# update vapp_vm set vapp_id='0c7a8d3e-a88e-4cd1-a452-e757c958cdc8' where cvm_id='4a11edc5-4881-4233-8ecf-43ec970d571b';


UPDATE 1



    • List resource pools' details:


 WRONG:


vcloud=# select * from vrp_rp where sub_rp_moref='resgroup-1'; 


 


RIGHT:


vcloud=# select * from vrp_rp where sub_rp_moref='resgroup-2';                      



    • List values from computevm and match them with resource pools' details


vcloud=# select * from computevm where id in ((select cvm_id from vapp_vm where svm_id in (select id from vm where name like '%NAME_OF_VM%')));



    • confirm that these values are not okay according to info collected on step before (vrp_id, computehub_id and sub_rp_moref)

    • correct the values using the output from before:


vcloud=# update computevm set vrp_id='XXXXX-XXXX-XXXX-XXXX-XXXXX' where id in ((select cvm_id from vapp_vm where svm_id in (select id from vm where name like '%NAME_OF_VM%')));


UPDATE 83


vcloud=# update computevm set computehub_id='ZZZZZ-ZZZZ-ZZZZ-ZZZZ-ZZZZZ' where id in ((select cvm_id from vapp_vm where svm_id in (select id from vm where name like '%NAME_OF_VM%')));


UPDATE 83


vcloud=# update computevm set deployment_status='DEPLOYED' where id in ((select cvm_id from vapp_vm where svm_id in (select id from vm where name like '%NAME_OF_VM%')));                       


UPDATE 83