← Back to team overview

openstack team mailing list archive

Re: [OpenStack][Nova]Start and Stop vm instances

 

Mandar,
    Thank you for reply.
    While,there are still some questions bothered me.

    It`s a fact that shutdown/stop operations are not separated for "libvirt_type=kvm",while, we can shutdown/stop instances of kvm type using libvirt command:
    
    virsh shutdown/destroy <vm id or vm name>
    
    In fact,this command only stoped the vm instance but not delete vm`s files.
    In general,that`s what users wanted when them sent the shutdown/stop command.Users just wanted 
to "stop" instances,not "delete" instances

According to your reply,I read the file nova/compute/manager.py and 
nova/virt/libvirt/connection.py. Then ,I found something like follows:

     def _destroy(self, instance, network_info, block_device_info=None,
                 cleanup=True):
        .................
        if virt_dom is not None:
            try:
                virt_dom.destroy()
        .................
            try:
                virt_dom.undefine() 
        .................
        if cleanup:
            self._cleanup(instance)
        .................
        
For "stop" instance not "delete" instance,whether if we only need to keep "virt_dom.destroy() "?

Waiting your reply. Thanks !

------------------
 Best Regards
  
 ZhangJialong
 



 
 
 
------------------ Original ------------------
From:  "Vaze, Mandar"<Mandar.Vaze@xxxxxxxxxxx>;
Date:  Wed, Jun 13, 2012 11:57 AM
To:  "??????"<zhangjl@xxxxxxxxxxx>; "openstack"<openstack@xxxxxxxxxxxxxxxxxxx>; 

Subject:  RE: [Openstack] [OpenStack][Nova]Start and Stop vm instances

 
    
>    Here is my question:
>    1. Is the stop operation of vm instance means to delete the vm and keep nothing except keep 
>    this record in databases ?
>    2. Is the start operation of vm means to creat a new vm instance according to the 
>    recorde in databases ?

While some hypervisors like Xen (Look at _shutdown method in nova/virt/xenapi/vmops.py) seem to have shutdown functionality,  for "libvirt_type=kvm" - there is no separate shutdown/stop.
(Probably that??s why) compute manager calls "self.driver.destroy" from _shutdown_instance() method  -  Look at nova/compute/manager.py if interested.

Hope this helps.

-Mandar
   


______________________________________________________________________
Disclaimer:This email and any attachments are sent in strictest confidence for the sole use of the addressee and may contain legally privileged, confidential, and proprietary data.  If you are not the intended recipient, please advise the sender by replying promptly to this email and then delete and destroy this email and any attachments without any further use, copying or forwarding