Re: Usage Records are still generating even VM removed.

2015-08-18 Thread Rajani Karuturi
update the usage_event table with VM.DESTROY event for this vm.
I would say create a vm, destroy it and observer the entries in usage_event
table. create a similar entry for the manually destroyed vm.


~Rajani

On Tue, Aug 18, 2015 at 12:12 AM, raja sekhar rajsekhar@gmail.com
wrote:

 Hi All,

 The usage records are still generating even if the vm is removed from
 cloudstack.
 The actual scenario is:
 The xenserver host went to alert state and the vms in it are not
 accessible.
 we have removed the vms from backend by updating vm_instance,volume table.
 can any one help me what is the exact table to update?
 i am using cloudstack 4.2

 waiting for your valuable suggestions.


 regards,
 rajasekhar.



AW: AW: Deleting Compute Offering

2015-08-18 Thread S . Brüseke - proIO GmbH
Hi Suneel,

thank you very much for that link!

Mit freundlichen Grüßen / With kind regards,

Swen Brüseke

-Ursprüngliche Nachricht-
Von: mvs babu [mailto:mvsbabu0...@outlook.com] 
Gesendet: Montag, 17. August 2015 14:08
An: users@cloudstack.apache.org
Betreff: RE: AW: Deleting Compute Offering

Hello Swen,


 


Below link will clarify your doubt, 


 


http://cloudstack-administration.readthedocs.org/en/latest/service_offerings.html#modifying-or-deleting-a-service-offering


 


Thank you,


Suneel Mallela.

 From: s.brues...@proio.com
 To: users@cloudstack.apache.org
 Subject: AW: Deleting Compute Offering
 Date: Mon, 17 Aug 2015 12:32:11 +0200
 
 Hi Somesh,
 
 thank you very much for testing!
 
 Mit freundlichen Grüßen / With kind regards,
 
 Swen Brüseke
 
 -Ursprüngliche Nachricht-
 Von: Somesh Naidu [mailto:somesh.na...@citrix.com]
 Gesendet: Freitag, 14. August 2015 18:12
 An: users@cloudstack.apache.org
 Betreff: RE: Deleting Compute Offering
 
 That is correct, you should be able to delete a compute offering even if 
 there are active VMs using it. I just performed a quick test for migrate and 
 stop/start operations work fine. I even performed a Reinstall VM operation 
 (that recreates a VM from template) and it worked fine.
 
 Regards,
 Somesh
 
 
 -Original Message-
 From: S. Brüseke - proIO GmbH [mailto:s.brues...@proio.com]
 Sent: Friday, August 14, 2015 5:04 AM
 To: users@cloudstack.apache.org
 Subject: AW: Deleting Compute Offering
 
 Hi Vadim,
 
 I am not 100% sure, but I think I was able to delete a compute offering while 
 VMs still using it.
 
 Mit freundlichen Grüßen / With kind regards,
 
 Swen
 
 -Ursprüngliche Nachricht-
 Von: Vadim Kimlaychuk [mailto:vadim.kimlayc...@elion.ee]
 Gesendet: Donnerstag, 13. August 2015 15:06
 An: users@cloudstack.apache.org; S. Brüseke - proIO GmbH
 Betreff: RE: Deleting Compute Offering
 
 Hello Swen,
 
   If I am not mistaken - you can't delete offering if it is used. You 
 will get an error. First -- you must assign new offering and then 
 remove the old one
 
 Vadim.
 
 -Original Message-
 From: S. Brüseke - proIO GmbH [mailto:s.brues...@proio.com]
 Sent: Thursday, August 13, 2015 1:29 PM
 To: users@cloudstack.apache.org
 Subject: Deleting Compute Offering
 
 Hi,
 
 I need to delete a Compute Offering because it is using a storage tag of a 
 primary storage which we want to get rid of in the future and I do not want 
 users to still be able to deploy new VMs on this primary storage. Of course 
 it is easy to delete the offering, but what will happen with existing VMs 
 using this offering?
 Will I be still able to use live migration and start/stop them?
 We re using CS 4.3
 
 Mit freundlichen Grüßen / With kind regards,
 
 Swen Brüseke
 
 
 
 - proIO GmbH -
 Geschäftsführer: Swen Brüseke
 Sitz der Gesellschaft: Frankfurt am Main
 
 USt-IdNr. DE 267 075 918
 Registergericht: Frankfurt am Main - HRB 86239
 
 Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte 
 Informationen. 
 Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich 
 erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie 
 diese Mail. 
 Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail sind nicht 
 gestattet. 
 
 This e-mail may contain confidential and/or privileged information. 
 If you are not the intended recipient (or have received this e-mail in error) 
 please notify the sender immediately and destroy this e-mail.  
 Any unauthorized copying, disclosure or distribution of the material in this 
 e-mail is strictly forbidden. 
 
 
 
 
 
 - proIO GmbH -
 Geschäftsführer: Swen Brüseke
 Sitz der Gesellschaft: Frankfurt am Main
 
 USt-IdNr. DE 267 075 918
 Registergericht: Frankfurt am Main - HRB 86239
 
 Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte 
 Informationen. 
 Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich 
 erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie 
 diese Mail. 
 Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail sind nicht 
 gestattet. 
 
 This e-mail may contain confidential and/or privileged information. 
 If you are not the intended recipient (or have received this e-mail in error) 
 please notify the sender immediately and destroy this e-mail.  
 Any unauthorized copying, disclosure or distribution of the material in this 
 e-mail is strictly forbidden. 
 
 
 
 
 
 - proIO GmbH -
 Geschäftsführer: Swen Brüseke
 Sitz der Gesellschaft: Frankfurt am Main
 
 USt-IdNr. DE 267 075 918
 Registergericht: Frankfurt am Main - HRB 86239
 
 Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte 
 Informationen. 
 Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich 
 erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie 
 diese Mail.
 Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail sind nicht 
 gestattet. 
 

Re: cloudstack + xen vhd的命名规则

2015-08-18 Thread Hongtu Zang
在DB里面看, cloud.volumes表里,有PATH,是实际存放的位置和名字

在 2015年8月10日 下午3:17,yanghu yan...@snailgame.net写道:

 请问 cloudstack + xen ,vhd的命名规则
 简单来说就是 如何找到vm / 卷 对应的 vhd 文件




 Add:苏州工业园区中新大道西171号
 平台官网:www.snail.com
 企业官网:about.snail.com
 请关注蜗牛新浪官方微博:http://weibo.com/woniushuzi


 本邮件及其附件所载内容可能含有保密信息并受法律保护,任何人切勿传播、分发、复制、印刷或使用本邮件之任何部分或其所载之任何内容。若您误收本邮件,请通知发件人,并删除原始邮件、附件及其所有复本。
 This email (including any attachments) is confidential, may be legally
 privileged and is for the intended recipient only. Access, disclosure,
 copying, distribution, or reliance on any of it by anyone else
  is prohibited. If you received this message in error, please contact the
 sender and destroy all copies of this email.


new timestamp format for API in ACS 4.5.1

2015-08-18 Thread tony_caotong


Hi All:

Does any one have any idea ? Thanks.

---
Cao Tong

On 08/18/2015 06:04 PM, tony_caot...@163.com wrote:


In ParamProcessWorker::setFieldValue() I found this lins:

   case DATE:
// This piece of code is for maintaining backward 
compatibility

// and support both the date formats(Bug 9724)

Is it related to my problem?  Where can I found the descriptions about 
BUG9724 ?


---
Cao Tong

On 08/18/2015 05:54 PM, tony_caot...@163.com wrote:


Hello,

When I use timestamp format startdate=2015-07-31, it works find.
When I use it like this startdate=2015-07-31 13:00:00.
It return a error
IOError: ('http error', 401, 'Unauthorized', httplib.HTTPMessage 
instance at 0x16dca70)


Could anyone tell me why ?

I have read the code 
DefaultLoginAPIAuthenticatorCmd::authenticate() , but I am still 
not understand what was happening,

it seems authenticate failed, but why??

---
Cao Tong

On 07/31/2015 07:07 PM, tony_caot...@163.com wrote:


Hi,

was this format is enabled in ACS 4.5.1 like /-MM-dd HH:mm:ss


/I found it in 4.5.0 API doc, but it seems not enabled.

http://cloudstack.apache.org/api/apidocs-4.5/user/listEvents.html

 api.listEvents(startdate=2015-07-31 13:00:00)
Traceback (most recent call last):
  File stdin, line 1, in module
  File call.py, line 48, in handlerFunction
return self._make_request(name, kwargs)
  File call.py, line 60, in _make_request
data = self._http_get(self.value)
  File call.py, line 53, in _http_get
response = urllib.urlopen(url)
  File /usr/lib64/python2.7/urllib.py, line 87, in urlopen
return opener.open(url)
  File /usr/lib64/python2.7/urllib.py, line 208, in open
return getattr(self, name)(url)
  File /usr/lib64/python2.7/urllib.py, line 359, in open_http
return self.http_error(url, fp, errcode, errmsg, headers)
  File /usr/lib64/python2.7/urllib.py, line 372, in http_error
result = method(url, fp, errcode, errmsg, headers)
  File /usr/lib64/python2.7/urllib.py, line 683, in http_error_401
errcode, errmsg, headers)
  File /usr/lib64/python2.7/urllib.py, line 381, in 
http_error_default

raise IOError, ('http error', errcode, errmsg, headers)
IOError: ('http error', 401, 'Unauthorized', httplib.HTTPMessage 
instance at 0x16dca70)




my ACS version:

[root@cs ~]# rpm -qa |grep cloud
cloudstack-management-4.5.1-shapeblue0.el6.x86_64
cloudstack-awsapi-4.5.1-shapeblue0.el6.x86_64
cloudstack-agent-4.5.1-shapeblue0.el6.x86_64
cloudstack-common-4.5.1-shapeblue0.el6.x86_64













Re: cloudstack怎样通过ssh连接虚拟机

2015-08-18 Thread Hongtu Zang
1、看你的环境,如果是高级隔离网络,需要加NAT规则
2、禁止ping了
3、4.2版本之前是6m1ll10n,之后是password

在 2015年7月20日 下午4:56,aby wu aby...@gmail.com写道:


 1.我通过端口转发可以访问到虚拟机实例上面的http服务器,证明可以进行通信了.但是不懂怎样在另外一台机子上通过ssh去操作虚拟机,而不是通过浏览器控制台(输入反应反应比较慢),
 2.还有就是为什么ping不通虚拟路由器?
 3.虚拟路由器的默认登录账户名和密码是多少?

 求大神指点迷津~



Re: new timestamp format for API in ACS 4.5.1

2015-08-18 Thread tony_caotong


Hello,

When I use timestamp format startdate=2015-07-31, it works find.
When I use it like this startdate=2015-07-31 13:00:00.
It return a error
IOError: ('http error', 401, 'Unauthorized', httplib.HTTPMessage 
instance at 0x16dca70)


Could anyone tell me why ?

I have read the code DefaultLoginAPIAuthenticatorCmd::authenticate() , 
but I am still not understand what was happening,

it seems authenticate failed, but why??

---
Cao Tong

On 07/31/2015 07:07 PM, tony_caot...@163.com wrote:


Hi,

was this format is enabled in ACS 4.5.1 like /-MM-dd HH:mm:ss


/I found it in 4.5.0 API doc, but it seems not enabled.

http://cloudstack.apache.org/api/apidocs-4.5/user/listEvents.html

 api.listEvents(startdate=2015-07-31 13:00:00)
Traceback (most recent call last):
  File stdin, line 1, in module
  File call.py, line 48, in handlerFunction
return self._make_request(name, kwargs)
  File call.py, line 60, in _make_request
data = self._http_get(self.value)
  File call.py, line 53, in _http_get
response = urllib.urlopen(url)
  File /usr/lib64/python2.7/urllib.py, line 87, in urlopen
return opener.open(url)
  File /usr/lib64/python2.7/urllib.py, line 208, in open
return getattr(self, name)(url)
  File /usr/lib64/python2.7/urllib.py, line 359, in open_http
return self.http_error(url, fp, errcode, errmsg, headers)
  File /usr/lib64/python2.7/urllib.py, line 372, in http_error
result = method(url, fp, errcode, errmsg, headers)
  File /usr/lib64/python2.7/urllib.py, line 683, in http_error_401
errcode, errmsg, headers)
  File /usr/lib64/python2.7/urllib.py, line 381, in http_error_default
raise IOError, ('http error', errcode, errmsg, headers)
IOError: ('http error', 401, 'Unauthorized', httplib.HTTPMessage 
instance at 0x16dca70)




my ACS version:

[root@cs ~]# rpm -qa |grep cloud
cloudstack-management-4.5.1-shapeblue0.el6.x86_64
cloudstack-awsapi-4.5.1-shapeblue0.el6.x86_64
cloudstack-agent-4.5.1-shapeblue0.el6.x86_64
cloudstack-common-4.5.1-shapeblue0.el6.x86_64







Re: Usage Records are still generating even VM removed.

2015-08-18 Thread raja sekhar
Hi Rajani,

Thanks for your reply.
i have created one testvm and manually destroyed from cloud ui.
the db entry in events table is:

select * from usage_event where type='VM.DESTROY'\G
*** 519. row ***
   id: 36520
 type: VM.DESTROY
   account_id: 62
  created: 2015-07-21 07:53:45
  zone_id: 1
  resource_id: 752
resource_name: testvm
  offering_id: 78
  template_id: 333
 size: NULL
resource_type: XenServer
processed: 1
 virtual_size: NULL

*i compared these entries to my vm:*

select * from usage_event where resource_name='appserver'\G
*** 18. row ***
   id: 30714
 type: VM.DESTROY
   account_id: 29
  created: 2015-03-17 14:31:24
  zone_id: 1
  resource_id: 311
resource_name: AppServer
  offering_id: 34
  template_id: 257
 size: NULL
resource_type: XenServer
processed: 1
 virtual_size: NULL

*i found that these two tables are same.*
*below are the few tables of the vm.*
*please suggest me what is the exact table to stop usage records.*

select * from cloud_usage where vm_name='AppServer'\G
*** 1289. row ***
id: 679340
   zone_id: 1
account_id: 29
 domain_id: 12
   description: AppServer running time (ServiceOffering: 34) (Template: 257)
 usage_display: 24 Hrs
usage_type: 1
 raw_usage: 24
vm_instance_id: 311
   vm_name: AppServer
   offering_id: 34
   template_id: 257
  usage_id: 311
  type: XenServer
  size: NULL
network_id: NULL
start_date: 2015-08-17 00:00:00
  end_date: 2015-08-17 23:59:59
  virtual_size: NULL

select * from vm_instance where name='appserver'\G
*** 2. row ***
  id: 311
name: AppServer
uuid: 0802d513-0bda-43d5-9600-20f705ca1ed7
   instance_name: i-29-311-VM
   state: Expunging
  vm_template_id: 257
 guest_os_id: 54
 private_mac_address: 02:00:4a:a8:00:04
  private_ip_address: 10.10.10.17
  pod_id: 1
  data_center_id: 1
 host_id: NULL
last_host_id: 14
proxy_id: 299
   proxy_assign_time: 2013-08-26 21:11:17
vnc_password: uPk1EIH5AmWi+djshYFcg7BtBXVzYHgQ866UT0/nV28=
  ha_enabled: 0
   limit_cpu_use: 0
update_count: 33
 update_time: 2015-03-17 14:32:35
 created: 2013-08-23 01:28:39
 removed: 2015-08-14 12:57:21
type: User
 vm_type: User
  account_id: 29
   domain_id: 12
 service_offering_id: 34
  reservation_id: 99128765-61b1-4e9f-b703-f20715a10a78
 hypervisor_type: XenServer
disk_offering_id: NULL
 cpu: NULL
 ram: NULL
   owner: 29
   speed: 1024
   host_name: AppServer
display_name: AppServer
   desired_state: NULL
dynamically_scalable: 0
  display_vm: 1

mysql select * from volumes where instance_id=311\G
*** 1. row ***
id: 427
account_id: 29
 domain_id: 12
   pool_id: 208
  last_pool_id: NULL
   instance_id: 311
 device_id: 0
  name: ROOT-311
  uuid: c253355e-a33c-4590-9b5e-74f7fa0c32cc
  size: 53687091200
folder: lvm
  path: ed119650-671e-4328-9ff2-2aefaac625a9
pod_id: 1
data_center_id: 1
iscsi_name: NULL
   host_ip: NULL
   volume_type: ROOT
 pool_type: LVM
  disk_offering_id: 34
   template_id: 257
first_snapshot_backup_uuid: NULL
   recreatable: 0
   created: 2013-08-23 01:28:39
  attached: NULL
   updated: 2015-03-17 14:32:35
   removed: 2015-05-03 02:57:00
 state: Destroy
chain_info: NULL
  update_count: 1025
 disk_type: NULL
vm_snapshot_chain_size: NULL
iso_id: NULL
display_volume: 1
format: VHD
  min_iops: NULL
  max_iops: NULL


regards,
rajasekhar.

On Tue, Aug 18, 2015 at 11:49 AM, Rajani Karuturi raj...@apache.org wrote:

 update the usage_event table with VM.DESTROY event for this vm.
 I would say create a vm, destroy it and observer the entries in usage_event
 table. create a similar entry for the manually destroyed vm.


 ~Rajani

 On Tue, Aug 18, 2015 at 12:12 AM, raja sekhar rajsekhar@gmail.com
 wrote:

  Hi All,
 
  The usage records are still generating even if the vm is removed from
  cloudstack.
  The actual scenario is:
  The 

Re: Usage Records are still generating even VM removed.

2015-08-18 Thread Rajani Karuturi
can you compare events for both the vms using
select * from usage_event where type like 'VM%' and resource_id in (311,
752);
May be a stop event is missing.

the same table is also present in cloud_usage database. compare the events
in that table as well.


~Rajani

On Wed, Aug 19, 2015 at 4:42 AM, raja sekhar rajsekhar@gmail.com
wrote:

 Hi Rajani,

 Thanks for your reply.
 i have created one testvm and manually destroyed from cloud ui.
 the db entry in events table is:

 select * from usage_event where type='VM.DESTROY'\G
 *** 519. row ***
id: 36520
  type: VM.DESTROY
account_id: 62
   created: 2015-07-21 07:53:45
   zone_id: 1
   resource_id: 752
 resource_name: testvm
   offering_id: 78
   template_id: 333
  size: NULL
 resource_type: XenServer
 processed: 1
  virtual_size: NULL

 *i compared these entries to my vm:*

 select * from usage_event where resource_name='appserver'\G
 *** 18. row ***
id: 30714
  type: VM.DESTROY
account_id: 29
   created: 2015-03-17 14:31:24
   zone_id: 1
   resource_id: 311
 resource_name: AppServer
   offering_id: 34
   template_id: 257
  size: NULL
 resource_type: XenServer
 processed: 1
  virtual_size: NULL

 *i found that these two tables are same.*
 *below are the few tables of the vm.*
 *please suggest me what is the exact table to stop usage records.*

 select * from cloud_usage where vm_name='AppServer'\G
 *** 1289. row ***
 id: 679340
zone_id: 1
 account_id: 29
  domain_id: 12
description: AppServer running time (ServiceOffering: 34) (Template:
 257)
  usage_display: 24 Hrs
 usage_type: 1
  raw_usage: 24
 vm_instance_id: 311
vm_name: AppServer
offering_id: 34
template_id: 257
   usage_id: 311
   type: XenServer
   size: NULL
 network_id: NULL
 start_date: 2015-08-17 00:00:00
   end_date: 2015-08-17 23:59:59
   virtual_size: NULL

 select * from vm_instance where name='appserver'\G
 *** 2. row ***
   id: 311
 name: AppServer
 uuid: 0802d513-0bda-43d5-9600-20f705ca1ed7
instance_name: i-29-311-VM
state: Expunging
   vm_template_id: 257
  guest_os_id: 54
  private_mac_address: 02:00:4a:a8:00:04
   private_ip_address: 10.10.10.17
   pod_id: 1
   data_center_id: 1
  host_id: NULL
 last_host_id: 14
 proxy_id: 299
proxy_assign_time: 2013-08-26 21:11:17
 vnc_password: uPk1EIH5AmWi+djshYFcg7BtBXVzYHgQ866UT0/nV28=
   ha_enabled: 0
limit_cpu_use: 0
 update_count: 33
  update_time: 2015-03-17 14:32:35
  created: 2013-08-23 01:28:39
  removed: 2015-08-14 12:57:21
 type: User
  vm_type: User
   account_id: 29
domain_id: 12
  service_offering_id: 34
   reservation_id: 99128765-61b1-4e9f-b703-f20715a10a78
  hypervisor_type: XenServer
 disk_offering_id: NULL
  cpu: NULL
  ram: NULL
owner: 29
speed: 1024
host_name: AppServer
 display_name: AppServer
desired_state: NULL
 dynamically_scalable: 0
   display_vm: 1

 mysql select * from volumes where instance_id=311\G
 *** 1. row ***
 id: 427
 account_id: 29
  domain_id: 12
pool_id: 208
   last_pool_id: NULL
instance_id: 311
  device_id: 0
   name: ROOT-311
   uuid: c253355e-a33c-4590-9b5e-74f7fa0c32cc
   size: 53687091200
 folder: lvm
   path: ed119650-671e-4328-9ff2-2aefaac625a9
 pod_id: 1
 data_center_id: 1
 iscsi_name: NULL
host_ip: NULL
volume_type: ROOT
  pool_type: LVM
   disk_offering_id: 34
template_id: 257
 first_snapshot_backup_uuid: NULL
recreatable: 0
created: 2013-08-23 01:28:39
   attached: NULL
updated: 2015-03-17 14:32:35
removed: 2015-05-03 02:57:00
  state: Destroy
 chain_info: NULL
   update_count: 1025
  disk_type: NULL
 vm_snapshot_chain_size: NULL
 iso_id: NULL
 display_volume: 1
 format: VHD
   min_iops: NULL
   max_iops: NULL


 regards,
 rajasekhar.

 On Tue, Aug 18, 

auto scaling configuration with netscaler

2015-08-18 Thread cloud stack
Hi all ,

We have tested tagging network works in advance zone for default isolated
network where the three networks assigned as follow
 -management network assigned to vlan1 (192,168.1.x)
 -public network assigned to vlan2 (192,168.2.x)
 -guest network assigned to vlan3 and vlan4 (192,168.3,4.x)


In details,  VM got assigned to IP from guest network, and this IP
encapsulated  by the second IP from the public network. Thus, we can ping
the public IP from management network and access the webapp as well.

However, once the customized isolated network that support netscaler
instead of a virtual router used to create load balancer feature.

In this case,  we can not immediately reach the public IP of loadbalnacer
(192.168.2.14) as showing below from management network even though the
minimum vms ( with proper template used for the first test) is deployed and
running and we stop firewall in VM,XenServer, netscaler VM, and management
server.

# ping 192.168.2.14
PING 192.168.2.14 (192.168.2.14) 56(84) bytes of data.
From 192.168.1.1: icmp_seq=2 Redirect Host(New nexthop: 192.168.2.14)
From 192.168.1.1: icmp_seq=3 Redirect Host(New nexthop: 192.168.2.14)
From 192.168.1.1 icmp_seq=1 Destination Host Unreachable
From 192.168.1.1 icmp_seq=2 Destination Host Unreachable
From 192.168.1.1 icmp_seq=3 Destination Host Unreachable
64 bytes from 192.168.2.14: icmp_seq=4 ttl=255 time=0.262 ms
64 bytes from 192.168.2.14: icmp_seq=5 ttl=255 time=0.268 ms
64 bytes from 192.168.2.14: icmp_seq=6 ttl=255 time=0.260 ms

Any suggestion would be appreciated


Thanks,