2021.08.03 KVM IOPS limit

    <disk type='block' device='disk'>
      <driver name='qemu' type='raw' cache='none' io='native'/>
      <source dev='/dev/VolG00/hogeimage'/>
      <target dev='vda' bus='virtio'/>
      <alias name='virtio-disk0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
      <iotune>
        <total_iops_sec>100</total_iops_sec>
      </iotune>
    </disk>

https://libvirt.org/formatdomain.html

OpenNebulaでテンプレート以外で変更する場合

テンプレートでIO制限が設けられているが、すでに作成済みのVMのディスクIO制限を変更する場合

VM停止後、vm_poolのbodyを書き換えてあげる。

下記を追加

<TOTAL_IOPS_SEC><![CDATA[100]]></TOTAL_IOPS_SEC>
update vm_pool set body='<VM><ID>300</ID><UID>0</UID><GID>0</GID><UNAME>oneadmin</UNAME><GNAME>oneadmin</GNAME><NAME>matsuitest</NAME><PERMISSIONS><OWNER_U>1</OWNER_U><OWNER_M>1</OWNER_M><OWNER_A>0</OWNER_A><GROUP_U>0</GROUP_U><GROUP_M>0</GROUP_M><GROUP_A>0</GROUP_A><OTHER_U>0</OTHER_U><OTHER_M>0</OTHER_M><OTHER_A>0</OTHER_A></PERMISSIONS><LAST_POLL>1627944012</LAST_POLL><STATE>8</STATE><LCM_STATE>0</LCM_STATE><PREV_STATE>8</PREV_STATE><PREV_LCM_STATE>0</PREV_LCM_STATE><RESCHED>0</RESCHED><STIME>1597896663</STIME><ETIME>0</ETIME><DEPLOY_ID>one-300</DEPLOY_ID><MONITORING><CPU><![CDATA[0.0]]></CPU><DISKRDBYTES><![CDATA[67937928]]></DISKRDBYTES><DISKRDIOPS><![CDATA[3072]]></DISKRDIOPS><DISKWRBYTES><![CDATA[2098176]]></DISKWRBYTES><DISKWRIOPS><![CDATA[5]]></DISKWRIOPS><MEMORY><![CDATA[0]]></MEMORY><NETRX><![CDATA[20988]]></NETRX><NETTX><![CDATA[0]]></NETTX><STATE><![CDATA[a]]></STATE></MONITORING><TEMPLATE><AUTOMATIC_DS_REQUIREMENTS><![CDATA[("CLUSTERS/ID" @> 100) & (TM_MAD = "ceph")]]></AUTOMATIC_DS_REQUIREMENTS><AUTOMATIC_NIC_REQUIREMENTS><![CDATA[("CLUSTERS/ID" @> 100)]]></AUTOMATIC_NIC_REQUIREMENTS><AUTOMATIC_REQUIREMENTS><![CDATA[(CLUSTER_ID = 100) & !(PUBLIC_CLOUD = YES) & !(PIN_POLICY = PINNED)]]></AUTOMATIC_REQUIREMENTS><CONTEXT><CONTEXT><![CDATA[true]]></CONTEXT><DISK_ID><![CDATA[1]]></DISK_ID><ETH0_CONTEXT_FORCE_IPV4><![CDATA[]]></ETH0_CONTEXT_FORCE_IPV4><ETH0_DNS><![CDATA[8.8.8.8]]></ETH0_DNS><ETH0_EXTERNAL><![CDATA[]]></ETH0_EXTERNAL><ETH0_GATEWAY><![CDATA[10.10.111.126]]></ETH0_GATEWAY><ETH0_GATEWAY6><![CDATA[]]></ETH0_GATEWAY6><ETH0_IP><![CDATA[10.10.111.121]]></ETH0_IP><ETH0_IP6><![CDATA[]]></ETH0_IP6><ETH0_IP6_PREFIX_LENGTH><![CDATA[]]></ETH0_IP6_PREFIX_LENGTH><ETH0_IP6_ULA><![CDATA[]]></ETH0_IP6_ULA><ETH0_MAC><![CDATA[02:00:b4:de:bf:79]]></ETH0_MAC><ETH0_MASK><![CDATA[255.255.255.128]]></ETH0_MASK><ETH0_MTU><![CDATA[]]></ETH0_MTU><ETH0_NETWORK><![CDATA[]]></ETH0_NETWORK><ETH0_SEARCH_DOMAIN><![CDATA[8.8.4.4]]></ETH0_SEARCH_DOMAIN><ETH0_VLAN_ID><![CDATA[]]></ETH0_VLAN_ID><ETH0_VROUTER_IP><![CDATA[]]></ETH0_VROUTER_IP><ETH0_VROUTER_IP6><![CDATA[]]></ETH0_VROUTER_IP6><ETH0_VROUTER_MANAGEMENT><![CDATA[]]></ETH0_VROUTER_MANAGEMENT><ETH1_CONTEXT_FORCE_IPV4><![CDATA[]]></ETH1_CONTEXT_FORCE_IPV4><ETH1_DNS><![CDATA[]]></ETH1_DNS><ETH1_EXTERNAL><![CDATA[]]></ETH1_EXTERNAL><ETH1_GATEWAY><![CDATA[]]></ETH1_GATEWAY><ETH1_GATEWAY6><![CDATA[]]></ETH1_GATEWAY6><ETH1_IP><![CDATA[192.168.103.42]]></ETH1_IP><ETH1_IP6><![CDATA[]]></ETH1_IP6><ETH1_IP6_PREFIX_LENGTH><![CDATA[]]></ETH1_IP6_PREFIX_LENGTH><ETH1_IP6_ULA><![CDATA[]]></ETH1_IP6_ULA><ETH1_MAC><![CDATA[02:00:0a:0f:67:2a]]></ETH1_MAC><ETH1_MASK><![CDATA[255.255.0.0]]></ETH1_MASK><ETH1_MTU><![CDATA[]]></ETH1_MTU><ETH1_NETWORK><![CDATA[]]></ETH1_NETWORK><ETH1_SEARCH_DOMAIN><![CDATA[]]></ETH1_SEARCH_DOMAIN><ETH1_VLAN_ID><![CDATA[]]></ETH1_VLAN_ID><ETH1_VROUTER_IP><![CDATA[]]></ETH1_VROUTER_IP><ETH1_VROUTER_IP6><![CDATA[]]></ETH1_VROUTER_IP6><ETH1_VROUTER_MANAGEMENT><![CDATA[]]></ETH1_VROUTER_MANAGEMENT><IMAGE><![CDATA[Context]]></IMAGE><NETWORK><![CDATA[YES]]></NETWORK><SSH_PUBLIC_KEY><![CDATA[ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAgEA7JDBq5ODDkAkx4UzQHYNBt9XI9RjgvGqqZPij8iDPecxzlR5bCAuN3gqx++2+gs5uHHXu315sQAmoX9fBGsLe8TnKtLF0+h3clAEJIKCOgvaU+iPexq0gr0GhLllY282D4YNhNatmpSWYsPYF3nOKtcXYS7QDQ78f0AdrvDx8wAY2ONyXaqF3ZyunKlxAFnRDg+mOFDrper46mHf5GKE4sigdGi4zCqFxlcxn0tzefKHMnKJUd3LhUvl0m7YM1YnCA9pR+52+7dC7T9f8nI0NkpEYqLtATE3OqQ/gHEnGPd3z43F3fG8NLoHT78seX6OoZeOwUdcNT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+kevyQbJuaJrY5AH1ddokFnYJBZaRoiZSt7oWVunVgQKqAx1/8GaqGu/Cuu31X root@OpenNebula01]]></SSH_PUBLIC_KEY><TARGET><![CDATA[hda]]></TARGET><TOTAL_IOPS_SEC_MAX_LENGTH><![CDATA[300]]></TOTAL_IOPS_SEC_MAX_LENGTH></CONTEXT><CPU><![CDATA[2]]></CPU><CPU_MODEL><MODEL><![CDATA[host-passthrough]]></MODEL></CPU_MODEL><DISK><ALLOW_ORPHANS><![CDATA[mixed]]></ALLOW_ORPHANS><CACHE><![CDATA[writeback]]></CACHE><CEPH_HOST><![CDATA[ceph001 ceph004 ceph005]]></CEPH_HOST><CEPH_SECRET><![CDATA[cf3df355-43eb-4354-9865-bed5eab18294]]></CEPH_SECRET><CEPH_USER><![CDATA[libvirt]]></CEPH_USER><CLONE><![CDATA[YES]]></CLONE><CLONE_TARGET><![CDATA[SELF]]></CLONE_TARGET><CLUSTER_ID><![CDATA[0,100,101]]></CLUSTER_ID><DATASTORE><![CDATA[ceph]]></DATASTORE><DATASTORE_ID><![CDATA[115]]></DATASTORE_ID><DEV_PREFIX><![CDATA[vd]]></DEV_PREFIX><DISK_ID><![CDATA[0]]></DISK_ID><DISK_SNAPSHOT_TOTAL_SIZE><![CDATA[0]]></DISK_SNAPSHOT_TOTAL_SIZE><DISK_TYPE><![CDATA[RBD]]></DISK_TYPE><DRIVER><![CDATA[raw]]></DRIVER><IMAGE><![CDATA[CentOS-7.8_x86_64_ceph]]></IMAGE><IMAGE_ID><![CDATA[68]]></IMAGE_ID><IMAGE_STATE><![CDATA[2]]></IMAGE_STATE><IMAGE_UNAME><![CDATA[oneadmin]]></IMAGE_UNAME><LN_TARGET><![CDATA[NONE]]></LN_TARGET><ORIGINAL_SIZE><![CDATA[10240]]></ORIGINAL_SIZE><POOL_NAME><![CDATA[one]]></POOL_NAME><READONLY><![CDATA[NO]]></READONLY><SAVE><![CDATA[NO]]></SAVE><SIZE><![CDATA[51200]]></SIZE><SOURCE><![CDATA[one/one-68]]></SOURCE><TARGET><![CDATA[vda]]></TARGET><TM_MAD><![CDATA[ceph]]></TM_MAD><TOTAL_IOPS_SEC><![CDATA[100]]></TOTAL_IOPS_SEC><TYPE><![CDATA[RBD]]></TYPE></DISK><FEATURES><LOCALTIME><![CDATA[yes]]></LOCALTIME></FEATURES><GRAPHICS><LISTEN><![CDATA[0.0.0.0]]></LISTEN><PORT><![CDATA[6200]]></PORT><TYPE><![CDATA[VNC]]></TYPE></GRAPHICS><MEMORY><![CDATA[2048]]></MEMORY><NIC><AR_ID><![CDATA[3]]></AR_ID><BRIDGE><![CDATA[onebr4]]></BRIDGE><BRIDGE_TYPE><![CDATA[linux]]></BRIDGE_TYPE><CLUSTER_ID><![CDATA[100]]></CLUSTER_ID><DNS><![CDATA[8.8.8.8]]></DNS><GATEWAY><![CDATA[10.10.111.126]]></GATEWAY><IP><![CDATA[10.10.111.121]]></IP><MAC><![CDATA[02:00:b4:de:bf:79]]></MAC><NAME><![CDATA[NIC0]]></NAME><NETWORK><![CDATA[Global]]></NETWORK><NETWORK_ID><![CDATA[4]]></NETWORK_ID><NETWORK_MASK><![CDATA[255.255.255.128]]></NETWORK_MASK><NETWORK_UNAME><![CDATA[oneadmin]]></NETWORK_UNAME><NIC_ID><![CDATA[0]]></NIC_ID><SEARCH_DOMAIN><![CDATA[8.8.4.4]]></SEARCH_DOMAIN><SECURITY_GROUPS><![CDATA[0]]></SECURITY_GROUPS><TARGET><![CDATA[one-300-0]]></TARGET><VN_MAD><![CDATA[bridge]]></VN_MAD></NIC><NIC><AR_ID><![CDATA[9]]></AR_ID><BRIDGE><![CDATA[onebr2]]></BRIDGE><BRIDGE_TYPE><![CDATA[linux]]></BRIDGE_TYPE><CLUSTER_ID><![CDATA[100,101]]></CLUSTER_ID><FILTER_IP_SPOOFING><![CDATA[NO]]></FILTER_IP_SPOOFING><FILTER_MAC_SPOOFING><![CDATA[NO]]></FILTER_MAC_SPOOFING><IP><![CDATA[192.168.103.42]]></IP><MAC><![CDATA[02:00:0a:0f:67:2a]]></MAC><NAME><![CDATA[NIC1]]></NAME><NETWORK><![CDATA[OnApp Management]]></NETWORK><NETWORK_ID><![CDATA[2]]></NETWORK_ID><NETWORK_MASK><![CDATA[255.255.0.0]]></NETWORK_MASK><NETWORK_UNAME><![CDATA[oneadmin]]></NETWORK_UNAME><NIC_ID><![CDATA[1]]></NIC_ID><SECURITY_GROUPS><![CDATA[0]]></SECURITY_GROUPS><TARGET><![CDATA[one-300-1]]></TARGET><VN_MAD><![CDATA[bridge]]></VN_MAD></NIC><OS><BOOT><![CDATA[]]></BOOT></OS><SECURITY_GROUP_RULE><PROTOCOL><![CDATA[ALL]]></PROTOCOL><RULE_TYPE><![CDATA[OUTBOUND]]></RULE_TYPE><SECURITY_GROUP_ID><![CDATA[0]]></SECURITY_GROUP_ID><SECURITY_GROUP_NAME><![CDATA[default]]></SECURITY_GROUP_NAME></SECURITY_GROUP_RULE><SECURITY_GROUP_RULE><PROTOCOL><![CDATA[ALL]]></PROTOCOL><RULE_TYPE><![CDATA[INBOUND]]></RULE_TYPE><SECURITY_GROUP_ID><![CDATA[0]]></SECURITY_GROUP_ID><SECURITY_GROUP_NAME><![CDATA[default]]></SECURITY_GROUP_NAME></SECURITY_GROUP_RULE><TEMPLATE_ID><![CDATA[16]]></TEMPLATE_ID><TM_MAD_SYSTEM><![CDATA[ceph]]></TM_MAD_SYSTEM><VCPU><![CDATA[2]]></VCPU><VMID><![CDATA[300]]></VMID></TEMPLATE><USER_TEMPLATE><ERROR><![CDATA[Wed May 26 16:25:00 2021 : Error deploying virtual machine: Could not create domain from /var/lib/one//datastores/116/300/deployment.13]]></ERROR><HYPERVISOR><![CDATA[kvm]]></HYPERVISOR><INPUTS_ORDER><![CDATA[]]></INPUTS_ORDER><LABELS><![CDATA[CentOS,Ceph]]></LABELS><LOGO><![CDATA[images/logos/centos.png]]></LOGO><MEMORY_UNIT_COST><![CDATA[MB]]></MEMORY_UNIT_COST><SCHED_REQUIREMENTS><![CDATA[ID="1"]]></SCHED_REQUIREMENTS></USER_TEMPLATE><HISTORY_RECORDS><HISTORY><OID>300</OID><SEQ>18</SEQ><HOSTNAME>onhv1003</HOSTNAME><HID>3</HID><CID>100</CID><STIME>1627943948</STIME><ETIME>1627944012</ETIME><VM_MAD><![CDATA[kvm]]></VM_MAD><TM_MAD><![CDATA[ceph]]></TM_MAD><DS_ID>116</DS_ID><PSTIME>0</PSTIME><PETIME>0</PETIME><RSTIME>1627943948</RSTIME><RETIME>1627944012</RETIME><ESTIME>0</ESTIME><EETIME>0</EETIME><ACTION>19</ACTION><UID>0</UID><GID>0</GID><REQUEST_ID>9296</REQUEST_ID></HISTORY></HISTORY_RECORDS></VM>' where oid=300;