Tuesday, September 27, 2011

How to attach DVD Drive to a VM using Python(For Xen)

In this post I am going to tell you how to attach a DVD Drive to a newly created VM in Python. I faced a lot of challenges in determining how to attach a DVD Drive. Finally I found out a way.

We need to use the following code:-

Here, VM_ref refers to the uuid of newly created VM to which we want to add the DVD Drive. Every physical DVD Drive has its VDI which is stored in its properties and one can get it and pass it as one of the parameters to create a VBD linking DVD Drive with the VM. 

1 comment: