Hi Kyle,

My suggestion is take nic entry of the vm which is removed (in the same 
network) and edit it for your VM.
While editing take care of the values of instance_id, ip, mac_address, state, 
default_nic, removed, display_nic and strategy columns.


Thanks,
Jayapal

On 14-Apr-2015, at 9:18 AM, Sanjeev N <sanj...@apache.org> wrote:

> When a vm is in expunging state, NIC table entry should be marked as
> removed in DB. If you are sure about the IP address rendered by CS to the
> VM , you can try adding the entry in db.
> 
> On Tue, Apr 14, 2015 at 2:45 AM, Kyle Flavin <kyle.fla...@citrix.com> wrote:
> 
>> Jayapal,
>> Is it safe for me to attempt to re-add the entry through the database,
>> since the VM is still in use?
>> 
>> Also, I've noticed that there are expunged VM's with entries still in the
>> NIC table.  Should that be the case?  Or should the record have been
>> removed when the VM was deleted?
>> 
>> -----Original Message-----
>> From: Jayapal Reddy Uradi [mailto:jayapalreddy.ur...@citrix.com]
>> Sent: Sunday, April 12, 2015 10:24 PM
>> To: <users@cloudstack.apache.org>
>> Subject: Re: CloudStack hands out IP address of a stopped VM
>> 
>> Hi Kyle,
>> 
>> Cloudstack won't delete the nic entry, When VM is deleted it marked as
>> removed.
>> It might be deleted manually from the DB.
>> 
>> Thanks,
>> Jayapal
>> 
>> 
>> On 11-Apr-2015, at 1:49 AM, Kyle Flavin <kyle.fla...@citrix.com> wrote:
>> 
>>> Jayapal,
>>> Is there a reason why would the nic entry be empty?  When is the entry
>> cleared?  It looks like it must have been cleared after the VM was stopped.
>>> 
>>> -----Original Message-----
>>> From: Jayapal Reddy Uradi [mailto:jayapalreddy.ur...@citrix.com]
>>> Sent: Thursday, April 09, 2015 9:01 PM
>>> To: <users@cloudstack.apache.org>
>>> Subject: Re: CloudStack hands out IP address of a stopped VM
>>> 
>>> Hi Kyle,
>>> 
>>> When CS picks the ip for new vm from free ip pool excluding nic table
>> ip4_adress.
>>> In your case the nic entry for vm is empty due to this the ip will goes
>> free pool.
>>> 
>>> 
>>> Thanks,
>>> Jayapal
>>> 
>>> On 10-Apr-2015, at 9:20 AM, Sanjeev N <sanj...@apache.org>
>>> wrote:
>>> 
>>>> CS would not hand out the IPs of a stopped vm since the lease time is
>>>> infinite. If you are able to reproduce is consistently please open a
>>>> JIRA ticket.
>>>> 
>>>> On Fri, Apr 10, 2015 at 4:17 AM, Kyle Flavin <kyle.fla...@citrix.com>
>> wrote:
>>>> 
>>>>> Hi Jayapal,
>>>>> The first query against the nics table returned an empty set, while
>>>>> the second returned the hostname and IP address.  Here is the
>>>>> sanitized output from both queries:
>>>>> 
>>>>> 
>>>>> mysql> select instance_id,ip4_address  from nics where
>>>>> mysql> instance_id=<id>;
>>>>> Empty set (0.00 sec)
>>>>> 
>>>>> 
>>>>> mysql> select id, name, private_ip_address  from vm_instance  where
>>>>> id=<id>;
>>>>> +------+--------------------+--------------------+
>>>>> | id   | name               | private_ip_address |
>>>>> +------+--------------------+--------------------+
>>>>> | myid | myhostname | 1.1.1.1       |
>>>>> +------+--------------------+--------------------+
>>>>> 1 row in set (0.00 sec)
>>>>> 
>>>>> 
>>>>> 
>>>>> -----Original Message-----
>>>>> From: Jayapal Reddy Uradi [mailto:jayapalreddy.ur...@citrix.com]
>>>>> Sent: Thursday, April 09, 2015 5:32 AM
>>>>> To: <users@cloudstack.apache.org>
>>>>> Subject: Re: CloudStack hands out IP address of a stopped VM
>>>>> 
>>>>> Hi Kyle,
>>>>> 
>>>>> In my setup I have observed this for stopped VM, the nic table
>>>>> ip4_address set to 'null'.
>>>>> After that I am not able to reproduce the issue.
>>>>> I will keep looking into my setup for this issue.
>>>>> 
>>>>> Can you please send the below commands output from your setup.
>>>>> 
>>>>> #select instance_id,ip4_address  from nics where instance_id=
>>>>> <instance_id>; #select id, name, private_ip_address  from
>>>>> vm_instance where id=<id>;
>>>>> 
>>>>> 
>>>>> 
>>>>> Thanks,
>>>>> Jayapal
>>>>> 
>>>>> On 09-Apr-2015, at 6:10 AM, Kyle Flavin <kyle.fla...@citrix.com>
>> wrote:
>>>>> 
>>>>>> I'm trying to get some help understanding the following behavior.
>>>>>> 
>>>>>> Yesterday we had an instance of CloudStack giving out the IP
>>>>>> address of
>>>>> a stopped VM to a newly created VM.  The existing server was found
>>>>> in the MySQL database with the assigned IP (sanitized outputs):
>>>>>> 
>>>>>> mysql> select name,private_ip_address,state  from vm_instance where
>>>>>> mysql> name like "<myhost>%";
>>>>>> +--------------------+--------------------+---------+
>>>>>> | name               | private_ip_address | state   |
>>>>>> +--------------------+--------------------+---------+
>>>>>> | <myhost> | 1.1.1.1       | Stopped |
>>>>>> +--------------------+--------------------+---------+
>>>>>> 
>>>>>> The new server booted up, and was given that same 1.1.1.1 IP as
>>>>>> well,
>>>>> which caused a conflict in our external host management system.
>>>>>> 
>>>>>> It looks to me like the DHCP lease is expiring on the stopped VM,
>>>>>> and
>>>>> then CloudStack is just handing it out again.  However, it had
>>>>> previously been explained to me that CloudStack would not hand out
>>>>> IP's of stopped VM's (and I do see the IP address registered to the VM
>> in the database).
>>>>> Is that true and is this a possible bug, or is that the expected
>> behavior?
>>>>>> 
>>>>>> -Kyle
>>>>> 
>>>>> 
>>> 
>> 
>> 

Reply via email to