virtual machine with input specifications already exists


While in the progress of deploying new virtual machines the deployment of a virtual machine stopped in one particular pool. After doing some investigation the viewcomposer log gives me the following message:

Violation of UNIQUE KEY constraint ‘IX_SVI_SIM_CLONE_GUEST_NAME’. Cannot insert duplicate key in object ‘dbo.SVI_SIM_CLONE’

I created a support call with VMware, the responses I got where remove those particular record from the database. Removing those records didn’t solved the problem, cause those records were written in different tables, so we created a query which does the trick for us.

Doing a search first, so we know which records will be deleted:

# Finding VM from VM_NAME and BASE_DISK key

SELECT * FROM SVI_SC_BASE_DISK_KEYS

where PARENT_ID = (SELECT ID FROM  SVI_SIM_CLONE

WHERE  (VM_NAME = ‘<VM-NAME>’))

SELECT * FROM SVI_SIM_CLONE

WHERE (VM_NAME = ‘<VM-NAME>’)

When I know which records will be removed I used the following query to actually remove the records:

# delete VM from VM_NAME and BASE_DISK key

delete from SVI_SC_BASE_DISK_KEYS

where PARENT_ID = (SELECT ID FROM  SVI_SIM_CLONE

WHERE  (VM_NAME = ‘<VM-NAME>’))

delete FROM SVI_SIM_CLONE

WHERE (VM_NAME = ‘<VM-NAME>’)

After actually removing the faulty records i was able to deploy new virtual machines again.

Advertisements

One thought on “virtual machine with input specifications already exists

  1. Worked for me too!!! Thanks

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s