Now after the virtualization project management whats a report, where is shown how many vm's have 1 vcpu, 2 vcpu, 4 vcpu and 8 vcpu.
Is it possible to show this directly in a cake diagram.
Hi,
what you also can do :
download
Microsoft Chart Controls for Microsoft .NET Framework 3.5
http://www.microsoft.com/en-us/download/details.aspx?id=14422
then from this site
http://www.shogan.co.uk/vmware/generating-graphical-charts-with-vmware-powercli-powershell/
download
http://www.shogan.co.uk/wp-content/plugins/download-monitor/download.php?id=Create-Chart.zip
and
http://www.shogan.co.uk/wp-content/plugins/download-monitor/download.php?id=Create-HashTable.zip
then
$vms=get-vm (or get-vm -location "some-cluster" if you want to have vms from specific location on the chart)
$ht=@{}
$vms|Group-Object -Property numcpu |%{$ht.add(("Vcpus: "+$_.name),$_.Count)}
Create-Chart -ChartType Pie -ChartTitle "Vms and vcpus" -YAxisName "vpus" -XAxisName "vms" -ChartWidth 700 -ChartHeight 600 -DataHashTable $ht -FileName mychart
you should get mychart.png file like the one below i made it 5 minutes ago to test this out
You can use the PowerShell Group-Object cmdlet to get this information:
Get-VM | Group-Object -Property NumCpu
The number of vCPU's is in the Name column of the output.
You can use Luc's Export-XLS function to export the information to Excel and make a nice diagram from that.
Hi,
what you also can do :
download
Microsoft Chart Controls for Microsoft .NET Framework 3.5
http://www.microsoft.com/en-us/download/details.aspx?id=14422
then from this site
http://www.shogan.co.uk/vmware/generating-graphical-charts-with-vmware-powercli-powershell/
download
http://www.shogan.co.uk/wp-content/plugins/download-monitor/download.php?id=Create-Chart.zip
and
http://www.shogan.co.uk/wp-content/plugins/download-monitor/download.php?id=Create-HashTable.zip
then
$vms=get-vm (or get-vm -location "some-cluster" if you want to have vms from specific location on the chart)
$ht=@{}
$vms|Group-Object -Property numcpu |%{$ht.add(("Vcpus: "+$_.name),$_.Count)}
Create-Chart -ChartType Pie -ChartTitle "Vms and vcpus" -YAxisName "vpus" -XAxisName "vms" -ChartWidth 700 -ChartHeight 600 -DataHashTable $ht -FileName mychart
you should get mychart.png file like the one below i made it 5 minutes ago to test this out
Hey maybe, how has the wildest cake diagram
Just try to imagine that this is a cake like... focus .. focus.. yeah ! a cake !
Seriously, um.. i guess you need to check that MS chart library im sure they offer other kinds of charts, it was just an example.
Anyway... if you want to have it more like a cake either go through this :
http://msdn.microsoft.com/en-us/library/dd456674.aspx -> custom attributes
And from here you might adjust your cake to look more like a cake than a button
I'll see tomorrow how can i enchance this one myself too
Greg
Ok, more cakes
if you will edit the chart drawing function like this:
if (($ChartType -eq "Pie") -or ($ChartType -eq "pie")) {
$ChartArea.AxisX.Title = $XAxisName
$ChartArea.AxisY.Title = $YAxisName
$Chart.Series["Data"].ChartType = [System.Windows.Forms.DataVisualization.Charting.SeriesChartType]::Pie
$Chart.Series["Data"]["PieLabelStyle"] = "Outside"
$Chart.Series["Data"]["PieLineColor"] = "Black"
$Chart.Series["Data"]["PieDrawingStyle"] = "SoftEdge"
($Chart.Series["Data"].Points.FindMaxByValue())["Exploded"] = $true
$Chart.Series["Data"].Label = "#VALX = #VALY\n" # Give an X & Y Label to the data in the plot area (useful for Pie graph) (Display both axis labels, use: Y = #VALY\nX = #VALX)
you will get almost a cake:
If you will set it to default:
Ok, more cakes
if you will edit the chart drawing function like this:
if (($ChartType -eq "Pie") -or ($ChartType -eq "pie")) {
$ChartArea.AxisX.Title = $XAxisName
$ChartArea.AxisY.Title = $YAxisName
$Chart.Series["Data"].ChartType = [System.Windows.Forms.DataVisualization.Charting.SeriesChartType]::Pie
$Chart.Series["Data"]["PieLabelStyle"] = "Outside"
$Chart.Series["Data"]["PieLineColor"] = "Black"
$Chart.Series["Data"]["PieDrawingStyle"] = "Default"
($Chart.Series["Data"].Points.FindMaxByValue())["Exploded"] = $true
$Chart.Series["Data"].Label = "#VALX = #VALY\n" # Give an X & Y Label to the data in the plot area (useful for Pie graph) (Display both axis labels, use: Y = #VALY\nX = #VALX)
then i guess this one looks like a normal pie chart.
My loks like this.